gogs_nginx.conf.j2 702 B

1234567891011121314151617181920212223
  1. server {
  2. listen 443 ssl http2 default_server;
  3. listen [::]:443 ssl http2 default_server;
  4. server_name {{ gogs_domain }};
  5. include /etc/nginx/ssl.conf;
  6. ssl_certificate /var/lib/acme/live/{{ gogs_domain }}/fullchain;
  7. ssl_certificate_key /var/lib/acme/live/{{ gogs_domain }}/privkey;
  8. access_log off;
  9. location / {
  10. proxy_http_version 1.1;
  11. proxy_set_header Host $host;
  12. proxy_set_header X-Real-IP $remote_addr;
  13. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  14. proxy_set_header X-Forwarded-Proto $scheme;
  15. proxy_pass http://localhost:{{ gogs_port }};
  16. proxy_redirect off;
  17. }
  18. }