1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mobilizon_ynh.git synced 2024-09-03 19:46:19 +02:00

The nginx configuration has been changed with improvements and support for custom error pages.

This commit is contained in:
yalh76 2020-10-14 22:19:45 +02:00
parent 85deb71343
commit 2d64c17ed7

View file

@ -4,28 +4,46 @@ location / {
rewrite ^ https://$server_name$request_uri? permanent; rewrite ^ https://$server_name$request_uri? permanent;
} }
gzip off; gzip on;
proxy_http_version 1.1; gzip_disable "msie6";
proxy_set_header X-Real-IP $remote_addr; gzip_vary on;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript application/activity+json application/atom+xml;
# For Websocket support # the nginx default is 1m, not enough for large media uploads
client_max_body_size 16m;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade"; proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://localhost:__PORT__; proxy_pass http://localhost:__PORT__;
client_max_body_size 16m;
location ~* \.(css|js)$ { location ~* \.(css|js)$ {
root __FINALPATH__/mobilizon/priv/static; root __FINALPATH__/mobilizon/priv/static;
etag off; etag off;
expires 1y;
access_log off; access_log off;
add_header Cache-Control public; add_header Cache-Control "public, max-age=31536000, immutable";
}
location ~ ^/(media|proxy) {
etag off;
access_log off;
add_header Cache-Control "public, max-age=31536000, immutable";
proxy_pass http://localhost:__PORT__;
}
error_page 500 501 502 503 504 @error;
location @error {
root __FINALPATH__/mobilizon/priv/errors;
try_files /error.html 502;
} }
# Include SSOWAT user panel. # Include SSOWAT user panel.