1 # Sample nginx configuration file for phpBB.
2 # Global settings have been removed, copy them
3 # from your system's nginx.conf.
4 # Tested with nginx 0.8.35.
7 # Compression - requires gzip and gzip static modules.
11 gzip_http_version 1.1;
14 # Compression levels over 6 do not give an appreciable improvement
15 # in compression ratio, but take more resources.
18 # IE 6 and lower do not support gzip with Vary correctly.
20 # Before nginx 0.7.63:
21 #gzip_disable "MSIE [1-6]\.";
23 # Catch-all server for requests to invalid hosts.
24 # Also catches vulnerability scanners probing IP addresses.
26 # default specifies that this block is to be used when
27 # no other block matches.
35 # If you have domains with and without www prefix,
36 # redirect one to the other.
41 server_name myforums.com;
43 # A trick from http://wiki.nginx.org/Pitfalls#Taxing_Rewrites:
44 rewrite ^ http://www.myforums.com$request_uri permanent;
46 #rewrite ^(.*)$ http://www.myforums.com$1 permanent;
49 # The actual board domain.
52 server_name www.myforums.com;
57 # phpbb uses index.htm
58 index index.php index.html index.htm;
61 # Deny access to internal phpbb files.
62 location ~ /(config\.php|common\.php|includes|cache|files|store|images/avatars/upload) {
64 # deny was ignored before 0.8.40 for connections over IPv6.
65 # Use internal directive to prohibit access on older versions.
69 # Pass the php scripts to fastcgi server specified in upstream declaration.
73 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
74 # Unmodified fastcgi_params from nginx distribution.
75 include fastcgi_params;
78 # Deny access to version control system directories.
79 location ~ /\.svn|/\.git {
85 # If running php as fastcgi, specify php upstream.
87 server unix:/tmp/php.sock;