DEV Community

Discussion on: How to setup Nginx and PHP7.1 with FPM on Mac OS X without crying

Collapse
 
chiefoleka profile image
Valentine

What result did you get at the end of the day?

I mean, I wrote this about 1 year ago, so a lot might have changed since then.

Nonetheless, share what didn't work let me see if I can help.

Collapse
 
e4neilook profile image
e4ne

Hi Valentine!

Thanks for replying.

I might found a solutions that now works. It took me three days to reach there. Now the only thing I have left is to make a websocket proxy works properly with SSL.

You're right things seems to happens very rapidly. There are many non up to date articles out there that sometimes confusing a bit.

Your solution might work indeed if I had the pleasure to be use a new fresh sierra. But that was unfortunate not the case. I have been sort of messing up a few configurations, packages, not update, miss to set permissions, right user etc.

But now that is in right place/order.

The only thing I have left is to setup a properly websocket proxy to sort of prevent expose ports for the end-user. Here is what it looks like:

Thanks for helping , very kind of you!

....

http {

   ....

    server {
        listen          443 ssl;
        server_name     mydomain.com;
        client_max_body_size 20M;

        root            /Users/myusers/Documents/www/;

        access_log      /Users/myusers/Documents/logfiles/default-ssl.access.log  main;

        ssl_certificate      /Users/myusers/Documents/cert/mydomain.com/public_cert.crt;
        ssl_certificate_key  /Users/myusers/Documents/cert/mydomain.com/private_cert.key;

        ssl_session_timeout  5m;

        ssl_protocols  SSLv2 SSLv3 TLSv1;
        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers   on;


        location / {
            index  index.php index.html index.htm;
        }

        ....

        # For the websocket
        location /websocket/ {
            proxy_pass https://mydomain.com:8443;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_read_timeout 86400;
        }
    }

}

(note: everything working and SSL cert and php, permissions, etc.
But now I also have a node-js-server that is up and running correctly. the DNS mydomain.com is a changed host DNS, so its not live or real!
It points to localhost/127.0.0.1 in the hostfile on my machine, but that should work too).