Last active
March 1, 2021 13:42
-
-
Save Xeckt/90971681be0f1341f31fbc6f1a613060 to your computer and use it in GitHub Desktop.
Invision Powerboard Nginx Configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
server_name something.com; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
# Server listen options | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; | |
server_name something.com | |
root /var/www/; | |
index index.php index.html index.htm; | |
# SSL config # | |
ssl on; | |
ssl_prefer_server_ciphers on; | |
ssl_session_cache shared:SSL:10m; | |
ssl_certificate ssl/www.something.crt; | |
ssl_certificate_key ssl/www.something.key; | |
ssl_protocols TLSv1.2 TLSv1.3; | |
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384; | |
# SSL Config# | |
# Security Configuration # | |
server_tokens off; | |
add_header X-Frame-Options "SAMEORIGIN"; | |
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload"; | |
add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'" always; | |
add_header X-XSS-Protection "1; mode=block"; | |
add_header X-Content-Type-Options nosniff; | |
# Security Configuration # | |
location / { | |
try_files $uri $uri/ /index.php$is_args$args; | |
gzip_static on; | |
} | |
location ~ "\.(js|css|jpeg|jpg|gif|png|ico|map|otf|ttf)(\?|$)" { | |
try_files $uri /404error.php$is_args$args; | |
expires 365d; | |
} | |
location ~ \.php$ { | |
try_files $uri =404; | |
include fastcgi_params; | |
fastcgi_index index.php; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass at-forums-php:9000; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param PATH_INFO $fastcgi_path_info; | |
} | |
location ~ ^/(public|sitemap.xml|servers-sitemap.xml|robots.txt|favicon.ico)($|/) { | |
// Add logic if you want it public | |
} | |
location /forums/uploads { | |
location ~ "^.*\.(php|cgi|pl|php3|php4|php5|php6|phtml|shtml|([a-z0-9]{32}))$" { | |
deny all; | |
} | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment