43 lines
1 KiB
Nginx Configuration File
43 lines
1 KiB
Nginx Configuration File
|
# {{ ansible_managed }}
|
||
|
|
||
|
server {
|
||
|
listen 80;
|
||
|
listen [::]:80;
|
||
|
|
||
|
server_name {{ podman_forgejo_web_hostname }};
|
||
|
server_tokens off;
|
||
|
|
||
|
location /.well-known/acme-challenge/ {
|
||
|
root /var/www/certbot;
|
||
|
}
|
||
|
|
||
|
location / {
|
||
|
return 301 https://{{ podman_forgejo_web_hostname }}$request_uri;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
server {
|
||
|
listen 443 ssl;
|
||
|
listen [::]:443 ssl;
|
||
|
http2 on;
|
||
|
|
||
|
server_name {{ podman_forgejo_web_hostname }};
|
||
|
server_tokens off;
|
||
|
|
||
|
ssl_certificate /etc/letsencrypt/live/{{ podman_forgejo_web_hostname }}/fullchain.pem;
|
||
|
ssl_certificate_key /etc/letsencrypt/live/{{ podman_forgejo_web_hostname }}/privkey.pem;
|
||
|
|
||
|
location / {
|
||
|
proxy_pass http://forgejo:3000;
|
||
|
|
||
|
proxy_set_header Connection $http_connection;
|
||
|
proxy_set_header Upgrade $http_upgrade;
|
||
|
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;
|
||
|
|
||
|
client_max_body_size 512M;
|
||
|
}
|
||
|
}
|