ki-ansible-playbook/roles/nginx/templates/sites/ki.conf.j2

45 lines
1.1 KiB
Plaintext
Raw Normal View History

2021-09-13 18:11:04 +02:00
server {
listen 80;
listen [::]:80;
server_name {{ ki_host }};
if ($host = {{ ki_host }}) {
return 301 https://$host$request_uri;
}
return 404;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name {{ ki_host }};
location /api {
proxy_pass http://localhost:{{ ki_backend_port }};
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location / {
proxy_pass http://localhost:{{ ki_frontend_port }};
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
http2_max_field_size 512k;
http2_max_header_size 512k;
ssl on;
ssl_certificate /etc/letsencrypt/live/kidev.wtf-eg.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/kidev.wtf-eg.net/privkey.pem;
}