Skip to content

Instantly share code, notes, and snippets.

@fais3000
fais3000 / nginx-socketio-ssl-reverse-proxy.conf
Last active June 12, 2018 07:53 — forked from gmanau/nginx-socketio-ssl-reverse-proxy.conf
How to setup nginx as nodejs/socket.io reverse proxy over SSL
upstream upstream-nodejs {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name mydomain.com www.mydomain.com;
rewrite ^(.*) https://$host$1 permanent;
}
@fais3000
fais3000 / Virtual host settings for Nginx
Created February 12, 2017 13:26
Nginx Vhost settings for setting up server to serve PHP and Nodejs apps together
server {
listen 80;
server_name craftypixels.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
@fais3000
fais3000 / Vhost settings for Apache
Last active June 12, 2018 07:52
Apache2 Vhost settings for setting up server to serve PHP and Nodejs apps together
<Virtualhost>
ServerName craftypixels.com
ProxyPreserveHost on
ProxyPass /blog !
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
alias /blog /var/www/craftypixels/blog
DocumentRoot /var/www/craftypixels/blog/
Options -Indexes