forked from stove/dataset
better nginx support
This commit is contained in:
parent
f49ecd419f
commit
bf42da89ac
3 changed files with 11 additions and 30 deletions
|
@ -0,0 +1 @@
|
||||||
|
LANG=fr_FR.UTF-8
|
|
@ -5,36 +5,15 @@
|
||||||
# Configuration HTTP %%domainname
|
# Configuration HTTP %%domainname
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
%if %%wildcard
|
server_name %%domainname;
|
||||||
%set %%prefix = "*."
|
|
||||||
%else
|
|
||||||
%set %%prefix = ""
|
|
||||||
%end if
|
|
||||||
server_name %%prefix%%domainname;
|
|
||||||
error_page 403 404 502 503 504 /error.html;
|
error_page 403 404 502 503 504 /error.html;
|
||||||
|
|
||||||
location = /error.html{
|
location / {
|
||||||
root /var/www/html;
|
|
||||||
}
|
|
||||||
%for %%location in %%revprox['revprox_location_' + family]
|
|
||||||
%set %%location_str = %%str(%%location)
|
|
||||||
%if %%location_str != '/' and %%location_str.endswith('/')
|
|
||||||
%set %%location_str = %%location_str[:-1]
|
|
||||||
%end if
|
|
||||||
location %%location_str {
|
|
||||||
%if %%wildcard
|
|
||||||
if ($host ~* ".%%domainname" ) {
|
|
||||||
%else
|
|
||||||
if ($host = "%%domainname" ) {
|
|
||||||
%end if
|
|
||||||
rewrite ^(.*) https://$host$1 permanent;
|
rewrite ^(.*) https://$host$1 permanent;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
index error.html;
|
|
||||||
root /var/www/html;
|
|
||||||
}
|
}
|
||||||
# FIXME return 301 https://www.domain.com$request_uri; => https://www.nginx.com/blog/creating-nginx-rewrite-rules/
|
# FIXME return 301 https://www.domain.com$request_uri; => https://www.nginx.com/blog/creating-nginx-rewrite-rules/
|
||||||
%end for
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Configuration HTTPS %%domainname
|
# Configuration HTTPS %%domainname
|
||||||
|
@ -50,13 +29,13 @@ server {
|
||||||
}
|
}
|
||||||
|
|
||||||
%for %%location in %%revprox['revprox_location_' + family]
|
%for %%location in %%revprox['revprox_location_' + family]
|
||||||
|
%set %%location_str = %%str(%%location)
|
||||||
location %%location {
|
location %%location {
|
||||||
# FIXME proxy_bind A.A.A.A;
|
|
||||||
proxy_pass %%location['revprox_url_' + family];
|
proxy_pass %%location['revprox_url_' + family];
|
||||||
# %if %%location['revprox_is_websocket_' + family]
|
%if %%location['revprox_is_websocket_' + family]
|
||||||
# proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
# proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
# %else
|
%else
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-Host $host;
|
proxy_set_header X-Forwarded-Host $host;
|
||||||
|
@ -65,7 +44,7 @@ server {
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
proxy_set_header Destination $dest;
|
proxy_set_header Destination $dest;
|
||||||
# %end if
|
%end if
|
||||||
proxy_ssl_trusted_certificate /etc/pki/ca-trust/source/anchors/ca_ReverseProxy.crt;
|
proxy_ssl_trusted_certificate /etc/pki/ca-trust/source/anchors/ca_ReverseProxy.crt;
|
||||||
proxy_ssl_verify on;
|
proxy_ssl_verify on;
|
||||||
proxy_ssl_verify_depth 2;
|
proxy_ssl_verify_depth 2;
|
||||||
|
|
|
@ -79,7 +79,8 @@
|
||||||
<param name="linked_server" type="variable">revprox_client_server_domainname</param>
|
<param name="linked_server" type="variable">revprox_client_server_domainname</param>
|
||||||
<param name="linked_provider">revprox_is_websocket</param>
|
<param name="linked_provider">revprox_is_websocket</param>
|
||||||
<param name="dynamic" type="variable">revprox_client_external_domainname</param>
|
<param name="dynamic" type="variable">revprox_client_external_domainname</param>
|
||||||
<param name="leader_index" type="index"/>
|
<param name="leader_provider">revprox_location</param>
|
||||||
|
<param name="leader_value" type="variable">revprox_client_location</param>
|
||||||
<target>revprox_client_is_websocket</target>
|
<target>revprox_client_is_websocket</target>
|
||||||
</check>
|
</check>
|
||||||
<check name="set_linked_configuration">
|
<check name="set_linked_configuration">
|
||||||
|
|
Loading…
Reference in a new issue