Playbooks to a new Lilik
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
692 B

  1. server {
  2. listen {{ public_ip }}:80;
  3. server_name {{ server_fqdns | join(" ") }};
  4. # Redirect ACME Challenges to the upstream server port 80
  5. location /.well-known/acme-challenge/ {
  6. proxy_set_header X-Real-IP $remote_addr;
  7. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  8. proxy_set_header Host $host;
  9. proxy_set_header X-NginX-Proxy true;
  10. proxy_pass http://{{ hostvars | ip_from_inventory(ansible_hostname) }};
  11. }
  12. # Redirect to HTTPS all non-ACME requests
  13. location / {
  14. if ($request_method = POST) {
  15. return 307 https://$server_name$request_uri;
  16. }
  17. return 301 https://$server_name$request_uri;
  18. }
  19. }