chandler/install/nginx.conf

55 lines
1.3 KiB
Nginx Configuration File
Raw Normal View History

2021-09-16 13:35:51 +03:00
# nginx.conf file for chandler
#
# this is a example configuration file. adapt the config
# values to your own needs.
#
# the use of tls (e.g., let's encrypt) is recommended.
#
# to install, rename the file name, put it in
# /etc/nginx/sites-available and make a symlink to
# /etc/nginx/sites-enabled
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name domain.tld;
root /opt/chandler/htdocs;
client_max_body_size 100m;
2021-09-16 13:35:51 +03:00
ssl_certificate /path/to/fullchain.pem;
ssl_certificate_key /path/to/privkey.pem;
location / {
index index.php;
2021-09-16 19:20:50 +03:00
try_files $uri $uri/ /index.php$is_args$args;
2021-09-16 13:35:51 +03:00
}
# DO NOT DELETE "(?!well-known).*" if you want to use let's encrypt.
location ~ /\.(?!well-known).* {
deny all;
access_log off;
log_not_found off;
}
location ~ \index.php$ {
2021-09-16 13:35:51 +03:00
# include fastcgi.conf;
include fastcgi_params;
# choose one of the above depending on your distribution.
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
# when using a TCP socket, use the following:
# fastcgi_pass 127.0.0.1:9000;
2021-09-18 05:23:28 +03:00
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
2021-09-16 13:35:51 +03:00
}
}
server {
listen 80;
listen [::]:80;
server_name domain.tld;
return 301 https://$server_name$request_uri;
2021-09-16 19:20:50 +03:00
}