| # Main site the-sinner.net (forum phpbb3)
|
|
|
| server {
|
| #listen 80;
|
| listen 443 ssl;
|
| ssl_certificate /etc/letsencrypt/live/the-sinner.net/fullchain.pem;
|
| ssl_certificate_key /etc/letsencrypt/live/the-sinner.net/privkey.pem;
|
|
|
| server_name the-sinner.net www.the-sinner.net;
|
|
|
| root /var/www/localhost/htdocs/gentoo/forum;
|
|
|
| location / {
|
| # phpBB uses index.htm
|
| index index.php index.html index.htm;
|
| try_files $uri $uri/ @rewriteapp;
|
| }
|
|
|
| location @rewriteapp {
|
| rewrite ^(.*)$ /app.php/$1 last;
|
| }
|
|
|
| # Deny access to internal phpbb files.
|
| location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|(?<!ext/)phpbb(?!\w+)|store|vendor) {
|
| deny all;
|
| # deny was ignored before 0.8.40 for connections over IPv6.
|
| # Use internal directive to prohibit access on older versions.
|
| internal;
|
| }
|
|
|
| # Pass the php scripts to fastcgi server specified in upstream declaration.
|
| location ~ \.php(/|$) {
|
| # Unmodified fastcgi_params from nginx distribution.
|
| include fastcgi_params;
|
| # Necessary for php.
|
| fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
| fastcgi_param PATH_INFO $fastcgi_path_info;
|
| fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
| fastcgi_param DOCUMENT_ROOT $realpath_root;
|
| try_files $uri $uri/ /app.php$is_args$args;
|
| fastcgi_pass php;
|
| }
|
|
|
| # Correctly pass scripts for installer
|
| location /install/ {
|
| # phpBB uses index.htm
|
| try_files $uri $uri/ @rewrite_installapp =404;
|
|
|
| # Pass the php scripts to fastcgi server specified in upstream declaration.
|
| location ~ \.php(/|$) {
|
| # Unmodified fastcgi_params from nginx distribution.
|
| include fastcgi_params;
|
| # Necessary for php.
|
| fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
| fastcgi_param PATH_INFO $fastcgi_path_info;
|
| fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
| fastcgi_param DOCUMENT_ROOT $realpath_root;
|
| try_files $uri $uri/ /install/app.php$is_args$args =404;
|
| fastcgi_pass php;
|
| }
|
| }
|
|
|
| location @rewrite_installapp {
|
| rewrite ^(.*)$ /install/app.php/$1 last;
|
| }
|
|
|
| # Deny access to version control system directories.
|
| location ~ /\.svn|/\.git {
|
| deny all;
|
| internal;
|
| }
|
| }
|
|
|
| # If running php as fastcgi, specify php upstream.
|
| upstream php {
|
| server unix:/var/run/php8-fpm.sock;
|
| }
|