Divide add config and rproxy installation
This commit is contained in:
35
roles/addconfig/templates/server.conf.j2
Normal file
35
roles/addconfig/templates/server.conf.j2
Normal file
@@ -0,0 +1,35 @@
|
||||
upstream {{ rproxy_service_name }}.{{ ansible_domain }} {
|
||||
server {{ rproxy_service_address }}:{{ rproxy_service_port }};
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name {{ rproxy_service_name }}.{{ ansible_domain }};
|
||||
access_log /var/log/nginx/{{ rproxy_service_name }}.access.log;
|
||||
error_log /var/log/nginx/{{ rproxy_service_name }}.error.log;
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name {{ rproxy_service_name }}.{{ ansible_domain }};
|
||||
access_log /var/log/nginx/{{ rproxy_service_name }}.access.log;
|
||||
error_log /var/log/nginx/{{ rproxy_service_name }}.error.log;
|
||||
ssl_certificate /etc/nginx/certs/{{ rproxy_service_name }}.{{ ansible_domain }}.crt;
|
||||
ssl_certificate_key /etc/nginx/certs/{{ rproxy_service_name }}.{{ ansible_domain }}.key;
|
||||
ssl_protocols TLSv1.2;
|
||||
ssl_ciphers EECDH:+AES256:-3DES:!RSA+AES:!RSA+3DES:!NULL:!RC4;
|
||||
ssl_prefer_server_ciphers on;
|
||||
proxy_connect_timeout 600s;
|
||||
fastcgi_request_buffering off;
|
||||
fastcgi_buffers 64 4K;
|
||||
|
||||
location / {
|
||||
proxy_pass_header Server;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_pass http://{{ rproxy_service_name }}.{{ ansible_domain }}/;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user