mirror of
https://github.com/YunoHost-Apps/mobilizon_ynh.git
synced 2024-09-03 19:46:19 +02:00
Update nginx.conf
This commit is contained in:
parent
6e92a341d6
commit
b52ddbb573
1 changed files with 43 additions and 29 deletions
|
@ -1,42 +1,56 @@
|
||||||
location __PATH__/ {
|
#gzip on;
|
||||||
|
gzip_disable "msie6";
|
||||||
|
gzip_vary on;
|
||||||
|
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;
|
||||||
|
|
||||||
|
# the nginx default is 1m, not enough for large media uploads
|
||||||
|
client_max_body_size 50M;
|
||||||
|
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
|
||||||
|
location / {
|
||||||
# Force usage of https
|
# Force usage of https
|
||||||
if ($scheme = http) {
|
if ($scheme = http) {
|
||||||
rewrite ^ https://$server_name$request_uri? permanent;
|
rewrite ^ https://$server_name$request_uri? permanent;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
|
|
||||||
client_max_body_size 50M;
|
|
||||||
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
proxy_set_header Host $http_host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
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__;
|
||||||
|
|
||||||
location ~* \.(css|js)$ {
|
# Include SSOWAT user panel.
|
||||||
|
# include conf.d/yunohost_panel.conf.inc;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Let's Encrypt keeps its files here
|
||||||
|
location ^~ '/.well-known/acme-challenge' {
|
||||||
|
root /var/www/certbot;
|
||||||
|
default_type "text/plain";
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^/(js|css) {
|
||||||
root __FINALPATH__/live/priv/static;
|
root __FINALPATH__/live/priv/static;
|
||||||
etag off;
|
etag off;
|
||||||
access_log off;
|
access_log off;
|
||||||
more_set_headers "Cache-Control: public, max-age=31536000, immutable";
|
more_set_headers "Cache-Control: public, max-age=31536000, immutable";
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(media|proxy) {
|
location ~ ^/(media|proxy) {
|
||||||
etag off;
|
etag off;
|
||||||
access_log off;
|
access_log off;
|
||||||
more_set_headers "Cache-Control: public, max-age=31536000, immutable";
|
more_set_headers "Cache-Control: public, max-age=31536000, immutable";
|
||||||
proxy_pass http://localhost:__PORT__;
|
proxy_pass http://localhost:__PORT__;
|
||||||
}
|
|
||||||
|
|
||||||
error_page 500 501 502 503 504 @error;
|
|
||||||
|
|
||||||
# Include SSOWAT user panel.
|
|
||||||
include conf.d/yunohost_panel.conf.inc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
error_page 500 501 502 503 504 @error;
|
||||||
location @error {
|
location @error {
|
||||||
root __FINALPATH__/live/priv/errors;
|
root __FINALPATH__/live/priv/errors;
|
||||||
try_files /error.html 502;
|
try_files /error.html 502;
|
||||||
|
|
Loading…
Add table
Reference in a new issue