Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
58 lines (44 sloc) 1.65 KB
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name strichliste.yourdomain.tld;
root /var/www/strichliste.yourdomain.tld/public;
location / {
# try to serve file directly, fallback to index.php
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
#Avoid sending the security headers twice
fastcgi_param modHeadersAvailable true;
fastcgi_param front_controller_active true;
fastcgi_pass php-handler;
fastcgi_intercept_errors on;
fastcgi_request_buffering off;
# Prevents URIs that include the front controller. This will 404:
# http://domain.tld/index.php/some-path
# Remove the internal directive to allow URIs like this
internal;
}
# return 404 for all other php files not matching the front controller
# this prevents access to other php files you don't want to be accessible.
location ~ \.php$ {
return 404;
}
ssl_certificate /etc/letsencrypt/live/strichliste.yourdomain.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/strichliste.yourdomain.tld/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}
server {
listen [::]:80;
listen 80;
server_name strichliste.yourdomain.tld;
if ($host = strichliste.yourdomain.tld) {
return 301 https://$host$request_uri;
}
return 404;
}