From 5f2ffb2a7b06a5112c0c3b45803d499eaa4508b1 Mon Sep 17 00:00:00 2001 From: creme Date: Sun, 26 Sep 2021 09:19:15 +0000 Subject: [PATCH] add user site for negatethis.com --- etc/nginx/snippets/users/php_negatethis.conf | 12 ++++ .../user-sites-available/negatethis.com.conf | 58 +++++++++++++++++++ .../user-sites-enabled/negatethis.com.conf | 1 + 3 files changed, 71 insertions(+) create mode 100644 etc/nginx/snippets/users/php_negatethis.conf create mode 100644 etc/nginx/user-sites-available/negatethis.com.conf create mode 120000 etc/nginx/user-sites-enabled/negatethis.com.conf diff --git a/etc/nginx/snippets/users/php_negatethis.conf b/etc/nginx/snippets/users/php_negatethis.conf new file mode 100644 index 0000000..ab49a8a --- /dev/null +++ b/etc/nginx/snippets/users/php_negatethis.conf @@ -0,0 +1,12 @@ +location ~ \.php$ { + include fastcgi.conf; + + fastcgi_index index.php; + + if (!-f $request_filename) { + return 404; + } + + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass unix:/run/php/php-fpm-negatethis.sock; +} diff --git a/etc/nginx/user-sites-available/negatethis.com.conf b/etc/nginx/user-sites-available/negatethis.com.conf new file mode 100644 index 0000000..8bdca46 --- /dev/null +++ b/etc/nginx/user-sites-available/negatethis.com.conf @@ -0,0 +1,58 @@ +### negatethis.com - local ### +server { + include snippets/listen.conf; + server_name negatethis.com www.negatethis.com; + + error_log /home/negatethis/logs/negatethis.com-error.log crit; + + location / { + return 307 https://$host$request_uri; + } + + location /.well-known/acme-challenge/ { + alias /var/lib/letsencrypt/.well-known/acme-challenge/; + } +} + +server { + include snippets/listen_ssl.conf; + server_name negatethis.com www.negatethis.com; + + include snippets/ssl.conf; + + ssl_certificate /etc/letsencrypt/live/negatethis.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/negatethis.com/privkey.pem; + ssl_trusted_certificate /etc/letsencrypt/live/negatethis.com/chain.pem; + ssl_dhparam /etc/ssl/certs/envs_dhparam.pem; + + + server_tokens off; + add_header Strict-Transport-Security "max-age=63072000; preload"; + add_header X-Frame-Options "SAMEORIGIN"; + add_header X-Content-Type-Options nosniff; + add_header X-XSS-Protection "1; mode=block"; + + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; + + + error_log /home/negatethis/logs/negatethis.com-error.log crit; + + root /home/negatethis/public_html/; + index index.html index.php index.cgi index.py index.sh index.pl index.lua; + + location / { + add_header Access-Control-Allow-Origin *; + try_files $uri.html $uri $uri/ /index.php?$args ; + } + + location /cgi-bin { + gzip off; + include fastcgi_params; + fastcgi_pass unix:/var/run/fcgiwrap.socket; + } + + # include php and ssi + include snippets/users/php_negatethis.conf; + ssi on; +} diff --git a/etc/nginx/user-sites-enabled/negatethis.com.conf b/etc/nginx/user-sites-enabled/negatethis.com.conf new file mode 120000 index 0000000..7fc0224 --- /dev/null +++ b/etc/nginx/user-sites-enabled/negatethis.com.conf @@ -0,0 +1 @@ +/etc/nginx/user-sites-available/negatethis.com.conf \ No newline at end of file