share-lt/nginx/conf.d/app.conf

51 lines
1.5 KiB
Text
Raw Permalink Normal View History

server {
listen 8889;
# Redirect all HTTP requests to HTTPS
# return 301 https://$host$request_uri;
index index.php index.html;
# error_log /var/log/nginx/error.log;
error_log /dev/stderr debug;
# access_log /var/log/nginx/access.log;
access_log /dev/stdout;
root /var/www/public;
location ~ ^/(app|apps) {
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
# This is the "Don't Crash" magic for Reverb
# It tells Reverb the original connection was HTTPS
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Forward to Reverb's internal port
proxy_pass http://127.0.0.1:9001;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS on;
fastcgi_param HTTP_X_FORWARDED_PROTO https;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
gzip_static on;
}
location /storage/ {
alias /var/www/storage/app/public/;
autoindex on;
}
}