Skip to content

Instantly share code, notes, and snippets.

@uniacid
Created February 3, 2018 07:13
Show Gist options
  • Save uniacid/14764e981e448591a9fae3c93f4d7861 to your computer and use it in GitHub Desktop.
Save uniacid/14764e981e448591a9fae3c93f4d7861 to your computer and use it in GitHub Desktop.
Poker Nginx Vhost
server {
listen 80;
listen [::]:80;
server_name poker.local;
root /Users/steven.gonzalez/Sites/Pkr/monorepo/frontend/;
access_log /usr/local/etc/nginx/logs/poker.access.log main;
error_log /usr/local/etc/nginx/logs/poker.error.log warn;
location /apiws/rt {
rewrite /apiws(.*) /apiws/$1 break;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:3000;
}
location /api/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:3000/api/;
}
location /poker {
# root /Users/steven.gonzalez/Sites/Pkr/monorepo/frontend/current;
index index.html;
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
add_header 'Last-Modified' '';
expires off;
break;
}
location / {
# root /Users/steven.gonzalez/Sites/Pkr/monorepo/frontend/current;
index index.html;
try_files $uri /index.html;
# try_files $uri $uri/ /index.html;
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
add_header 'Last-Modified' '';
expires off;
break;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
# error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# root /usr/share/nginx/html;
# }
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment