apachesafari-push-notifications

How to configuring Httpd to handle Safari Agent Requests


Good evening everyone!

I am implementing Safari Push Notifications. I found a great tutorial on Medium.com There is one part of the proccess where I stuck. I do not know how to configure httpd to handle safari agent requests. The tutorial shows the way for Nginix. However, in my company we are using Apache httpd.

Here the instruction:

#Safari Push Package Request
location /push/v2/pushPackages/web.com.domain.appname {
      add_header "Access-Control-Allow-Origin"  *;
      allow all;
      fastcgi_pass 127.0.0.1:9000;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME /var/www/safari.push/index.php;
      include fastcgi_params;
}
#Safari Push Log
location /push/v2/log {

      add_header "Access-Control-Allow-Origin"  *;
      allow all;
      fastcgi_pass 127.0.0.1:9000;
      fastcgi_index log.php;
      fastcgi_param SCRIPT_FILENAME /var/www/safari.push/log.php;
      include fastcgi_params;
}

I am asking help from the community to direct me to the right direction. I do not even understand where to start google it.

Thank you!


Solution

  • All of the fastcgi stuff equivalent would be mod_proxy_fcgi in Apache. For proof of concept, you could skip fast cgi entirely and just point to CGI scripts.

    Apache has <Location> ... </Location> sections which are basically 1:1 with the location { } section above.

    nginx's add_header is just Header from mod_headers.