Skip to content

Instantly share code, notes, and snippets.

@Ghostscypher
Created September 7, 2021 14:43
Show Gist options
  • Save Ghostscypher/7fa8c3fdf74699c14590ad22ddcd5976 to your computer and use it in GitHub Desktop.
Save Ghostscypher/7fa8c3fdf74699c14590ad22ddcd5976 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name ws.example.com;
# For ssl support add correct path here
#ssl_certificate /path/to/www.example.com.cert;
#ssl_certificate_key /path/to/www.example.com.key;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
index index.php;
charset utf-8;
# Our configuration starts here
location /app/ {
proxy_pass http://127.0.0.1:6000/app/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
location /apps/ {
proxy_pass http://127.0.0.1:6000/apps/;
proxy_set_header Host $host;
}
# Our config ends here
# 404 for all other paths
location / {
return 404;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment