Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http {
- # Compression - requires gzip and gzip static modules.
- gzip on;
- gzip_static on;
- gzip_vary on;
- gzip_http_version 1.1;
- gzip_min_length 700;
- # Compression levels over 6 do not give an appreciable improvement
- # in compression ratio, but take more resources.
- gzip_comp_level 6;
- # IE 6 and lower do not support gzip with Vary correctly.
- gzip_disable "msie6";
- # Before nginx 0.7.63:
- #gzip_disable "MSIE [1-6]\.";
- # Catch-all server for requests to invalid hosts.
- # Also catches vulnerability scanners probing IP addresses.
- server {
- # default specifies that this block is to be used when
- # no other block matches.
- listen 80 default;
- server_name bogus;
- return 444;
- root /var/empty;
- }
- # If you have domains with and without www prefix,
- # redirect one to the other.
- server {
- # Default port is 80.
- #listen 80;
- server_name darkw.pl;
- # A trick from http://wiki.nginx.org/Pitfalls#Taxing_Rewrites:
- return 301 http://www.darkw.pl$request_uri;
- }
- # The actual board domain.
- server {
- #listen 80;
- server_name darkw.pl;
- # POPRAW JEΕLI JEST INNA \/
- root /public_html/;
- location / {
- # phpBB uses index.htm
- index index.php index.html index.htm;
- try_files $uri $uri/ @rewriteapp;
- }
- location @rewriteapp {
- rewrite ^(.*)$ /app.php/$1 last;
- }
- location / {
- if ($http_host ~* "^www.darkw.pl(.*)"){
- rewrite ^(.*)$ https://darkw.pl/$1 redirect;
- }
- rewrite ^(.*)$ https://$http_host$request_uri redirect;
- rewrite ^/(.*)-f([0-9]*)/mcp.php(.*) /mcp.php?$query_string redirect;
- rewrite ^/(.*)-f([0-9]*)/(.*)-t([0-9]*)-s([0-9]*).html /viewtopic.php?f=$2&t=$4&start=$5&$query_string break;
- rewrite ^/(.*)-f([0-9]*)/(.*)-t([0-9]*).html /viewtopic.php?f=$2&t=$4&$query_string break;
- rewrite ^/(.*)-f([0-9]*)/index-s([0-9]*).html /viewforum.php?f=$2&start=$3&$query_string break;
- rewrite ^/(.*)-f([0-9]*)/ /viewforum.php?f=$2&$query_string break;
- rewrite ^/(.*)-f([0-9]*) /viewforum.php?f=$2&$query_string break;
- if (!-e $request_filename){
- rewrite ^(.*)$ /app.php break;
- }
- }
- # Deny access to internal phpbb files.
- location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|(?<!ext/)phpbb|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;
- # 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;
- 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:/tmp/php.sock;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement