Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.


Warning for game developers: PCGamingWiki staff members will only ever reach out to you using the official press@pcgamingwiki.com mail address.
Be aware of scammers claiming to be representatives or affiliates of PCGamingWiki who promise a PCGW page for a game key.

User:JRWR/nginx

From PCGamingWiki, the wiki about fixing PC games
< User:JRWR
Revision as of 14:56, 8 March 2012 by JRWR (talk | contribs) (Created page with "== nginx.conf == <pre> user www-data; worker_processes 8; pid /var/run/nginx.pid; worker_rlimit_nofile 65000; events { worker_connections 2048; # multi_accept on; } http {...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

nginx.conf

user www-data;
worker_processes 8;
pid /var/run/nginx.pid;
worker_rlimit_nofile 65000;

events {
	worker_connections 2048;
	# multi_accept on;
}

http {

	##
	# Basic Settings
	##

	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	keepalive_timeout 65;
	types_hash_max_size 2048;
	server_tokens off;

	# server_names_hash_bucket_size 64;
	# server_name_in_redirect off;

	include /etc/nginx/mime.types;
	default_type application/octet-stream;

	##
	# Logging Settings
	##

	access_log /var/log/nginx/access.log;
	error_log /var/log/nginx/error.log;

	##
	# Gzip Settings
	##

	gzip on;
	gzip_disable "msie6";

	gzip_vary on;
	gzip_proxied any;
	gzip_comp_level 6;
	gzip_buffers 16 8k;
	gzip_http_version 1.1;
	gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
        
        fastcgi_cache_path  /var/cache/nginx  levels=1:2   keys_zone=one:500m;
	
        ##
	# Virtual Host Configs
	##

	include /etc/nginx/conf.d/*.conf;
	include /etc/nginx/sites-enabled/*;
}

httpblockwiki.conf

 server {
   listen 173.255.253.94:80;
   listen 127.0.0.1:80;
   listen [2600:3c01::f03c:91ff:fedf:6c49]:80;
   server_name _;

   root /var/www/;
   server_name_in_redirect off;
   error_page 502 503 504 /error.html;  

   location / {
     index index.php;
#    error_page 404 = @mediawiki;
     try_files $uri $uri/ /index.php?title=$uri&$args;
   }

#   location @mediawiki {
#     rewrite ^/([^?]*)(?:\?(.*))? /index.php?title=$1&$2 last;
#   }

   location ~ \.php?$ {
     include /etc/nginx/fastcgi_params;
     fastcgi_pass  127.0.0.1:9000;
     fastcgi_index index.php;
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     fastcgi_cache_valid  200 302 5m;
     fastcgi_cache_valid  301 1h;
     fastcgi_cache_valid  any 1m;
     fastcgi_cache_key "$scheme$request_method$host$request_uri";
     fastcgi_cache_use_stale updating error timeout invalid_header http_500;
     fastcgi_cache one;
     add_header X-Cache-Key $scheme$request_method$host$request_uri;
     add_header X-Cache-Status $upstream_cache_status;
     add_header X-Upstream-Time $upstream_response_time;
     fastcgi_ignore_headers X-Accel-Expires X-Accel-Redirect Expires Cache-Control;
     fastcgi_no_cache $bypasspiwik $cookie_piwik_auth $cookie_pcgamingwiki_pcgwiki_UserName $cookie_pcgamingwiki_pcgwiki_Token $cookie_wordpress_b65188f439c980f7217d6d087aa1ad55 $cookie_pcgamingwiki_pcgwiki__session;     
     fastcgi_cache_bypass $bypasspiwik $cookie_piwik_auth $cookie_pcgamingwiki_pcgwiki_UserName $cookie_pcgamingwiki_pcgwiki_Token $cookie_wordpress_b65188f439c980f7217d6d087aa1ad55 $cookie_pcgamingwiki_pcgwiki__session;
   } 
   location /nginx_status {
	  # copied from http://blog.kovyrin.net/2006/04/29/monitoring-nginx-with-rrdtool/
	  stub_status on;
	  access_log   off;
   }

     if ($fastcgi_script_name = "/piwik/piwik.php" ) {
       set $bypasspiwik  1;
   }
     if ($fastcgi_script_name = "/apc_info.php" ) {
       set $bypasspiwik  1;

   }
   location  /dumps/  {
  	autoindex  on;
   }

 }
}