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.

20 lines
613 B

  1. server {
  2. listen {{ public_ip }}:80;
  3. server_name {{ hostname }}.{{ domain }} www.{{ hostname }}.{{ domain }};
  4. location /.well-known/acme-challenge/ {
  5. proxy_set_header X-Real-IP $remote_addr;
  6. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  7. proxy_set_header Host $host;
  8. proxy_set_header X-NginX-Proxy true;
  9. proxy_pass http://{{ hostvars | ip_from_inventory(ansible_hostname) }};
  10. }
  11. location / {
  12. if ($request_method = POST) {
  13. return 307 https://$server_name$request_uri;
  14. }
  15. return 301 https://$server_name$request_uri;
  16. }
  17. }