server { root /dolibarr/htdocs; listen [::]:443 ssl; listen 443 ssl; ssl_certificate /etc/ssl/__dolibarr_domain__.crt; ssl_certificate_key /etc/ssl/private/__dolibarr_domain__.key; index index.html index.php; server_name __dolibar_domain__; location / { try_files $uri $uri/ =404; } location ~ [^/]\.php(/|$) { fastcgi_intercept_errors on; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; } } server { listen [::]:80; listen 80; server_name __dolibarr_domain__; if ($host = dolibarr.example.fr) { return 301 https://$host$request_uri; } }