From 1c229a8928bd9b7e82f0769b889db808b9249de9 Mon Sep 17 00:00:00 2001 From: frju365 Date: Thu, 2 Feb 2017 19:13:28 +0100 Subject: [PATCH] Create nginx.conf --- conf/nginx.conf | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 conf/nginx.conf diff --git a/conf/nginx.conf b/conf/nginx.conf new file mode 100644 index 0000000..732fb89 --- /dev/null +++ b/conf/nginx.conf @@ -0,0 +1,36 @@ +location __PATH__ { + if ($scheme = http) { + rewrite ^ https://$server_name$request_uri? permanent; + } + location ~ [^/]\.php(/|$) { + fastcgi_split_path_info ^(.+?\.php)(/.*)$; + fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param REMOTE_USER $remote_user; + fastcgi_param PATH_INFO $fastcgi_path_info; + } + + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; + + # This is important for user's privacy ! + access_log off; + error_log /var/log/nginx/lutim.error.log; + + # This is important ! Make it OK with your Lutim configuration + client_max_body_size 40M; + + proxy_pass http://127.0.0.1:__PORT__; + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + # Lutim reads this header and understands that the current session is actually HTTPS. + # Enable it if you run a HTTPS server (in this case, don't forgot to change the listen port $ + proxy_set_header X-Forwarded-Proto https; + + # We expect the downsteam servers to redirect to the right hostname, so don't do any rewrite$ + proxy_redirect off; +}