2017-02-07 22:29:21 +01:00
|
|
|
location __PATH__ {
|
2017-04-01 16:53:29 +02:00
|
|
|
if ($scheme = http) {
|
|
|
|
rewrite ^ https://$server_name$request_uri? permanent;
|
2017-02-07 22:29:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# This is important for user's privacy !
|
|
|
|
access_log off;
|
2017-04-01 18:16:18 +02:00
|
|
|
error_log /var/log/nginx/lufi.error.log;
|
2017-02-07 22:29:21 +01:00
|
|
|
|
|
|
|
# This is important ! Make it OK with your Lutim configuration
|
|
|
|
client_max_body_size 40M;
|
|
|
|
|
2017-04-01 16:53:29 +02:00
|
|
|
if ($request_uri ~* ^/(img|css|font|js)/) {
|
|
|
|
add_header Expires "Thu, 31 Dec 2037 23:55:55 GMT";
|
|
|
|
add_header Cache-Control "public, max-age=315360000";
|
|
|
|
}
|
|
|
|
|
2017-04-01 18:16:18 +02:00
|
|
|
proxy_pass http://127.0.0.1:__PORT__/__PATH__;
|
2017-04-01 16:53:29 +02:00
|
|
|
|
|
|
|
# Really important ! Lufi uses WebSocket, it won't work without this
|
|
|
|
proxy_set_header Upgrade $http_upgrade ;
|
|
|
|
proxy_set_header Connection "upgrade" ;
|
2017-02-07 22:29:21 +01:00
|
|
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
2017-04-01 16:53:29 +02:00
|
|
|
# If you want to log the remote port of the file senders, you'll need that
|
|
|
|
proxy_set_header X-Remote-Port $remote_port;
|
|
|
|
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
2017-02-07 22:29:21 +01:00
|
|
|
|
|
|
|
# We expect the downsteam servers to redirect to the right hostname, so don't do any rewrite$
|
|
|
|
proxy_redirect off;
|
2017-04-01 16:53:29 +02:00
|
|
|
|
|
|
|
#--PRIVATE--# Include SSOWAT user panel.
|
|
|
|
#--PRIVATE--include conf.d/yunohost_panel.conf.inc;
|
2017-02-07 22:29:21 +01:00
|
|
|
}
|