about summary refs log tree commit diff stats
path: root/tools/conf/etc/nginx/sites-enabled/forum.conf
diff options
context:
space:
mode:
authorSilvino Silva <silvino@bk.ru>2020-03-11 01:12:03 +0000
committerSilvino Silva <silvino@bk.ru>2020-03-11 01:17:28 +0000
commit8a5897ad0a5e82d389c119001e3feaeaf2d0b1c3 (patch)
treed0254fa780a2a4b2911cc452f88a2f6db8a2595d /tools/conf/etc/nginx/sites-enabled/forum.conf
parent24fa6cfc200a16a0d81ff4c7af96853db4028650 (diff)
downloaddoc-8a5897ad0a5e82d389c119001e3feaeaf2d0b1c3.tar.gz
nginx configuration update
Diffstat (limited to 'tools/conf/etc/nginx/sites-enabled/forum.conf')
-rw-r--r--tools/conf/etc/nginx/sites-enabled/forum.conf39
1 files changed, 39 insertions, 0 deletions
diff --git a/tools/conf/etc/nginx/sites-enabled/forum.conf b/tools/conf/etc/nginx/sites-enabled/forum.conf
new file mode 100644
index 0000000..14350e3
--- /dev/null
+++ b/tools/conf/etc/nginx/sites-enabled/forum.conf
@@ -0,0 +1,39 @@
+server {
+    listen 8080;
+    server_name forum.server.ank;
+
+    access_log syslog:server=unix:/dev/log,facility=daemon,tag=nginx_forum,nohostname main;
+    error_log syslog:server=unix:/dev/log,facility=daemon,tag=nginx_forum_err,nohostname debug;
+
+    root /srv/www/forum;
+
+    location / {
+        index index.php;
+        try_files $uri $uri/ index.php$is_args$args;
+    }
+
+    location ~ [^/]\.php(/|$) {
+
+        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
+        if (!-f $document_root$fastcgi_script_name) {
+            return 404;
+        }
+
+        # Mitigate https://httpoxy.org/ vulnerabilities
+        fastcgi_param HTTP_PROXY "";
+
+        fastcgi_pass 127.0.0.1:9000;
+        fastcgi_index index.php;
+
+        # include the fastcgi_param setting
+        include fastcgi_params;
+
+        # SCRIPT_FILENAME parameter is used for PHP FPM determining
+        #  the script name. If it is not set in fastcgi_params file,
+        # i.e. /etc/nginx/fastcgi_params or in the parent contexts,
+        # please comment off following line
+        fastcgi_param REQUEST_METHOD $request_method;
+        fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
+    }
+
+}