Add map for scheme...

master
andryyy 2017-05-03 22:26:10 +02:00
parent f1e4b4fb39
commit edc41b48d1
1 changed files with 22 additions and 18 deletions

View File

@ -1,4 +1,8 @@
proxy_cache_path /tmp levels=1:2 keys_zone=sogo:10m inactive=24h max_size=1g; proxy_cache_path /tmp levels=1:2 keys_zone=sogo:10m inactive=24h max_size=1g;
map $http_x_forwarded_proto $client_req_scheme {
default $scheme;
https https;
}
server { server {
include /etc/nginx/conf.d/listen_ssl.active; include /etc/nginx/conf.d/listen_ssl.active;
include /etc/nginx/mime.types; include /etc/nginx/mime.types;
@ -34,7 +38,7 @@ server {
real_ip_recursive on; real_ip_recursive on;
location = /principals/ { location = /principals/ {
rewrite ^ $scheme://$http_host/SOGo/dav; rewrite ^ $client_req_scheme://$http_host/SOGo/dav;
allow all; allow all;
} }
@ -61,17 +65,17 @@ server {
} }
location ~ /(?:a|A)utodiscover/(?:a|A)utodiscover.xml { location ~ /(?:a|A)utodiscover/(?:a|A)utodiscover.xml {
fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass phpfpm:9000; fastcgi_pass phpfpm:9000;
include /etc/nginx/fastcgi_params; include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
try_files /autodiscover.php =404; try_files /autodiscover.php =404;
} }
location ~ /(?:m|M)ail/(?:c|C)onfig-v1.1.xml { location ~ /(?:m|M)ail/(?:c|C)onfig-v1.1.xml {
fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass phpfpm:9000; fastcgi_pass phpfpm:9000;
include /etc/nginx/fastcgi_params; include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
try_files /autoconfig.php =404; try_files /autoconfig.php =404;
} }
@ -92,7 +96,7 @@ server {
proxy_set_header x-webobjects-server-protocol HTTP/1.0; proxy_set_header x-webobjects-server-protocol HTTP/1.0;
proxy_set_header x-webobjects-remote-host $remote_addr; proxy_set_header x-webobjects-remote-host $remote_addr;
proxy_set_header x-webobjects-server-name $server_name; proxy_set_header x-webobjects-server-name $server_name;
proxy_set_header x-webobjects-server-url $scheme://$http_host; proxy_set_header x-webobjects-server-url $client_req_scheme://$http_host;
proxy_set_header x-webobjects-server-port $server_port; proxy_set_header x-webobjects-server-port $server_port;
client_body_buffer_size 128k; client_body_buffer_size 128k;
client_max_body_size 100m; client_max_body_size 100m;
@ -106,7 +110,7 @@ server {
proxy_set_header x-webobjects-server-protocol HTTP/1.0; proxy_set_header x-webobjects-server-protocol HTTP/1.0;
proxy_set_header x-webobjects-remote-host $remote_addr; proxy_set_header x-webobjects-remote-host $remote_addr;
proxy_set_header x-webobjects-server-name $server_name; proxy_set_header x-webobjects-server-name $server_name;
proxy_set_header x-webobjects-server-url $scheme://$http_host; proxy_set_header x-webobjects-server-url $client_req_scheme://$http_host;
proxy_set_header x-webobjects-server-port $server_port; proxy_set_header x-webobjects-server-port $server_port;
client_body_buffer_size 128k; client_body_buffer_size 128k;
client_max_body_size 100m; client_max_body_size 100m;
@ -179,7 +183,7 @@ server {
real_ip_recursive on; real_ip_recursive on;
location = /principals/ { location = /principals/ {
rewrite ^ $scheme://$http_host/SOGo/dav; rewrite ^ $client_req_scheme://$http_host/SOGo/dav;
allow all; allow all;
} }
@ -206,17 +210,17 @@ server {
} }
location ~ /(?:a|A)utodiscover/(?:a|A)utodiscover.xml { location ~ /(?:a|A)utodiscover/(?:a|A)utodiscover.xml {
fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass phpfpm:9000; fastcgi_pass phpfpm:9000;
include /etc/nginx/fastcgi_params; include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
try_files /autodiscover.php =404; try_files /autodiscover.php =404;
} }
location ~ /(?:m|M)ail/(?:c|C)onfig-v1.1.xml { location ~ /(?:m|M)ail/(?:c|C)onfig-v1.1.xml {
fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass phpfpm:9000; fastcgi_pass phpfpm:9000;
include /etc/nginx/fastcgi_params; include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
try_files /autoconfig.php =404; try_files /autoconfig.php =404;
} }
@ -237,7 +241,7 @@ server {
proxy_set_header x-webobjects-server-protocol HTTP/1.0; proxy_set_header x-webobjects-server-protocol HTTP/1.0;
proxy_set_header x-webobjects-remote-host $remote_addr; proxy_set_header x-webobjects-remote-host $remote_addr;
proxy_set_header x-webobjects-server-name $server_name; proxy_set_header x-webobjects-server-name $server_name;
proxy_set_header x-webobjects-server-url $scheme://$http_host; proxy_set_header x-webobjects-server-url $client_req_scheme://$http_host;
proxy_set_header x-webobjects-server-port $server_port; proxy_set_header x-webobjects-server-port $server_port;
client_body_buffer_size 128k; client_body_buffer_size 128k;
client_max_body_size 100m; client_max_body_size 100m;
@ -251,7 +255,7 @@ server {
proxy_set_header x-webobjects-server-protocol HTTP/1.0; proxy_set_header x-webobjects-server-protocol HTTP/1.0;
proxy_set_header x-webobjects-remote-host $remote_addr; proxy_set_header x-webobjects-remote-host $remote_addr;
proxy_set_header x-webobjects-server-name $server_name; proxy_set_header x-webobjects-server-name $server_name;
proxy_set_header x-webobjects-server-url $scheme://$http_host; proxy_set_header x-webobjects-server-url $client_req_scheme://$http_host;
proxy_set_header x-webobjects-server-port $server_port; proxy_set_header x-webobjects-server-port $server_port;
client_body_buffer_size 128k; client_body_buffer_size 128k;
client_max_body_size 100m; client_max_body_size 100m;