12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- ## YOURLS site config
- server {
- listen 80;
- listen [::]:80;
- listen 443 ssl;
- listen [::]:443 ssl;
- server_name up.demu.red;
- root /var/www/up;
- access_log /var/log/nginx/up_access.log;
- error_log /var/log/nginx/up_error.log;
- ## Disable all methods besides HEAD, GET and POST.
- if ($request_method !~ ^(GET|HEAD|POST)$ ) {
- return 444;
- }
- index index.php index.html /_h5ai/public/index.php;
- ## Include certbot fix
- include /etc/nginx/snippets/nginx.well-known.conf;
- ## Include ssl
- include /etc/nginx/snippets/nginx.ssl.conf;
- ### Deny Stuffs ### {{{
- ## Protect specific TXT and config files
- location ~ /(\.|readme.html|readme.md|changelog.txt|changelog.md|contributing.txt|contributing.md|license.txt|license.md|legalnotice|privacy.txt|privacy.md|security.txt|security.md|sample-.*txt)
- {
- deny all;
- }
- ## Protect .git files
- location ~ /\.git/ {
- access_log off;
- log_not_found off;
- deny all;
- }
- ### End Deny Stuffs ### }}}
- location / {
- location ~ ^(.+\.php)(.*)$ {
- fastcgi_split_path_info ^(.+\.php)(.*)$;
- try_files $uri =404;
- fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
- fastcgi_index index.php;
- ## https://stackoverflow.com/questions/28490391/how-to-properly-configure-alias-directive-in-nginx
- fastcgi_param SCRIPT_FILENAME $request_filename;
- include fastcgi_params;
- }
- location ~ /_h5ai {
- access_log off;
- }
- }
- ## Using h5ai instead https://larsjung.de/h5ai/
- ## Enable nginx dir index
- #location / {
- #autoindex on;
- #}
- ## Error Redirects
- # Done on purpose, as the main page is all in one.
- error_page 403 /index.html;
- error_page 404 /index.html;
- error_page 405 /index.html;
- error_page 500 501 502 503 504 /index.html;
- }
|