Consolidate nginx configs

This commit is contained in:
Disassembler 2018-01-08 15:27:29 +01:00
parent bb7171f3e1
commit df000f4473
25 changed files with 90 additions and 143 deletions

View File

@ -1,12 +1,10 @@
server { server {
listen 80 default_server; listen [::]:80 default_server ipv6only=off;
listen [::]:80 default_server;
return 301 https://$host$request_uri; return 301 https://$host$request_uri;
} }
server { server {
listen 443 ssl http2 default_server; listen [::]:443 ssl http2 default_server ipv6only=off;
listen [::]:443 ssl http2 default_server;
add_header Strict-Transport-Security "max-age=31536000;"; add_header Strict-Transport-Security "max-age=31536000;";

View File

@ -18,6 +18,5 @@ rc-update add ckan-datapusher boot
service ckan-datapusher start service ckan-datapusher start
# Create nginx app definition # Create nginx app definition
cp ${SOURCE_DIR}/etc/nginx/apps/ckan-datapusher /etc/nginx/apps/ckan-datapusher
cp ${SOURCE_DIR}/etc/nginx/conf.d/ckan-datapusher.conf /etc/nginx/conf.d/ckan-datapusher.conf cp ${SOURCE_DIR}/etc/nginx/conf.d/ckan-datapusher.conf /etc/nginx/conf.d/ckan-datapusher.conf
service nginx reload service nginx reload

View File

@ -1,9 +0,0 @@
access_log /var/log/nginx/ckan-datapusher.access.log;
error_log /var/log/nginx/ckan-datapusher.error.log;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:9004;
}

View File

@ -1,5 +1,13 @@
server { server {
listen 127.0.0.1:8004; listen [::1]:8004 ipv6only=off;
listen [::1]:8004;
include apps/ckan-datapusher; access_log /var/log/nginx/ckan-datapusher.access.log;
error_log /var/log/nginx/ckan-datapusher.error.log;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:9004;
}
} }

View File

@ -48,7 +48,6 @@ rc-update add ckan boot
service ckan start service ckan start
# Create nginx app definition # Create nginx app definition
cp ${SOURCE_DIR}/etc/nginx/apps/ckan /etc/nginx/apps/ckan
cp ${SOURCE_DIR}/etc/nginx/conf.d/ckan.conf /etc/nginx/conf.d/ckan.conf cp ${SOURCE_DIR}/etc/nginx/conf.d/ckan.conf /etc/nginx/conf.d/ckan.conf
service nginx reload service nginx reload

View File

@ -1,9 +0,0 @@
access_log /var/log/nginx/ckan.access.log;
error_log /var/log/nginx/ckan.error.log;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:9003;
}

View File

@ -1,11 +1,14 @@
server { server {
listen 8003; listen [::]:8003 ipv6only=off;
listen [::]:8003; listen [::]:8403 ssl http2 ipv6only=off;
include apps/ckan;
}
server { access_log /var/log/nginx/ckan.access.log;
listen 8403 ssl http2; error_log /var/log/nginx/ckan.error.log;
listen [::]:8403 ssl http2;
include apps/ckan; location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:9003;
}
} }

View File

@ -36,7 +36,6 @@ rc-update add crisiscleanup boot
service crisiscleanup start service crisiscleanup start
# Create nginx app definition # Create nginx app definition
cp ${SOURCE_DIR}/etc/nginx/apps/crisiscleanup /etc/nginx/apps/crisiscleanup
cp ${SOURCE_DIR}/etc/nginx/conf.d/crisiscleanup.conf /etc/nginx/conf.d/crisiscleanup.conf cp ${SOURCE_DIR}/etc/nginx/conf.d/crisiscleanup.conf /etc/nginx/conf.d/crisiscleanup.conf
service nginx reload service nginx reload

View File

@ -1,9 +0,0 @@
access_log /var/log/nginx/crisiscleanup.access.log;
error_log /var/log/nginx/crisiscleanup.error.log;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:9005;
}

View File

@ -1,11 +1,14 @@
server { server {
listen 8005; listen [::]:8005 ipv6only=off;
listen [::]:8005; listen [::]:8405 ssl http2 ipv6only=off;
include apps/crisiscleanup;
}
server { access_log /var/log/nginx/crisiscleanup.access.log;
listen 8405 ssl http2; error_log /var/log/nginx/crisiscleanup.error.log;
listen [::]:8405 ssl http2;
include apps/crisiscleanup; location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:9005;
}
} }

1
cts.sh
View File

@ -40,7 +40,6 @@ rc-update add cts boot
service cts start service cts start
# Create nginx app definition # Create nginx app definition
cp ${SOURCE_DIR}/etc/nginx/apps/cts /etc/nginx/apps/cts
cp ${SOURCE_DIR}/etc/nginx/conf.d/cts.conf /etc/nginx/conf.d/cts.conf cp ${SOURCE_DIR}/etc/nginx/conf.d/cts.conf /etc/nginx/conf.d/cts.conf
service nginx reload service nginx reload

View File

@ -1,9 +0,0 @@
access_log /var/log/nginx/cts.access.log;
error_log /var/log/nginx/cts.error.log;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:9006;
}

View File

@ -1,11 +1,14 @@
server { server {
listen 8006; listen [::]:8006 ipv6only=off;
listen [::]:8006; listen [::]:8406 ssl http2 ipv6only=off;
include apps/cts;
}
server { access_log /var/log/nginx/cts.access.log;
listen 8406 ssl http2; error_log /var/log/nginx/cts.error.log;
listen [::]:8406 ssl http2;
include apps/cts; location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:9006;
}
} }

View File

@ -30,7 +30,6 @@ rc-update add gnuhealth boot
service gnuhealth start service gnuhealth start
# Create nginx app definition # Create nginx app definition
cp ${SOURCE_DIR}/etc/nginx/apps/gnuhealth /etc/nginx/apps/gnuhealth
cp ${SOURCE_DIR}/etc/nginx/conf.d/gnuhealth.conf /etc/nginx/conf.d/gnuhealth.conf cp ${SOURCE_DIR}/etc/nginx/conf.d/gnuhealth.conf /etc/nginx/conf.d/gnuhealth.conf
service nginx reload service nginx reload

View File

@ -1,9 +0,0 @@
access_log /var/log/nginx/gnuhealth.access.log;
error_log /var/log/nginx/gnuhealth.error.log;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:9008;
}

View File

@ -1,11 +1,14 @@
server { server {
listen 8008; listen [::]:8008 ipv6only=off;
listen [::]:8008; listen [::]:8408 ssl http2 ipv6only=off;
include apps/gnuhealth;
}
server { access_log /var/log/nginx/gnuhealth.access.log;
listen 8408 ssl http2; error_log /var/log/nginx/gnuhealth.error.log;
listen [::]:8408 ssl http2;
include apps/gnuhealth; location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:9008;
}
} }

View File

@ -26,7 +26,6 @@ rc-update add kanboard boot
service kanboard start service kanboard start
# Create nginx app definition # Create nginx app definition
cp ${SOURCE_DIR}/etc/nginx/apps/kanboard /etc/nginx/apps/kanboard
cp ${SOURCE_DIR}/etc/nginx/conf.d/kanboard.conf /etc/nginx/conf.d/kanboard.conf cp ${SOURCE_DIR}/etc/nginx/conf.d/kanboard.conf /etc/nginx/conf.d/kanboard.conf
service nginx reload service nginx reload

View File

@ -1,9 +0,0 @@
access_log /var/log/nginx/kanboard.access.log;
error_log /var/log/nginx/kanboard.error.log;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:9009;
}

View File

@ -1,11 +1,14 @@
server { server {
listen 8009; listen [::]:8009 ipv6only=off;
listen [::]:8009; listen [::]:8409 ssl http2 ipv6only=off;
include apps/kanboard;
}
server { access_log /var/log/nginx/kanboard.access.log;
listen 8409 ssl http2; error_log /var/log/nginx/kanboard.error.log;
listen [::]:8409 ssl http2;
include apps/kanboard; location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:9009;
}
} }

View File

@ -19,7 +19,6 @@ rc-update add openmapkit boot
service openmapkit start service openmapkit start
# Create nginx app definition # Create nginx app definition
cp ${SOURCE_DIR}/etc/nginx/apps/openmapkit /etc/nginx/apps/openmapkit
cp ${SOURCE_DIR}/etc/nginx/conf.d/openmapkit.conf /etc/nginx/conf.d/openmapkit.conf cp ${SOURCE_DIR}/etc/nginx/conf.d/openmapkit.conf /etc/nginx/conf.d/openmapkit.conf
service nginx reload service nginx reload

View File

@ -1,9 +0,0 @@
access_log /var/log/nginx/openmapkit.access.log;
error_log /var/log/nginx/openmapkit.error.log;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:9007;
}

View File

@ -1,11 +1,14 @@
server { server {
listen 8007; listen [::]:8007 ipv6only=off;
listen [::]:8007; listen [::]:8407 ssl http2 ipv6only=off;
include apps/openmapkit;
}
server { access_log /var/log/nginx/openmapkit.access.log;
listen 8407 ssl http2; error_log /var/log/nginx/openmapkit.error.log;
listen [::]:8407 ssl http2;
include apps/openmapkit; location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:9007;
}
} }

View File

@ -30,7 +30,6 @@ rc-update add seeddms boot
service seeddms start service seeddms start
# Create nginx app definition # Create nginx app definition
cp ${SOURCE_DIR}/etc/nginx/apps/seeddms /etc/nginx/apps/seeddms
cp ${SOURCE_DIR}/etc/nginx/conf.d/seeddms.conf /etc/nginx/conf.d/seeddms.conf cp ${SOURCE_DIR}/etc/nginx/conf.d/seeddms.conf /etc/nginx/conf.d/seeddms.conf
service nginx reload service nginx reload

View File

@ -1,9 +0,0 @@
access_log /var/log/nginx/seeddms.access.log;
error_log /var/log/nginx/seeddms.error.log;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:9010;
}

View File

@ -1,11 +1,14 @@
server { server {
listen 8010; listen [::]:8010 ipv6only=off;
listen [::]:8010; listen [::]:8410 ssl http2 ipv6only=off;
include apps/seeddms;
}
server { access_log /var/log/nginx/seeddms.access.log;
listen 8410 ssl http2; error_log /var/log/nginx/seeddms.error.log;
listen [::]:8410 ssl http2;
include apps/seeddms; location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:9010;
}
} }