Skip to content

Instantly share code, notes, and snippets.

@raptium
Created February 4, 2009 02:06
Show Gist options
  • Save raptium/57881 to your computer and use it in GitHub Desktop.
Save raptium/57881 to your computer and use it in GitHub Desktop.
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain application/xml application/json application/x-javascript;
gzip_disable "MSIE [1-6]\.";
sub_filter http://shk
https://shkcorpps1.corp.shkp.com.hk/http://shk;
sub_filter_types application/json;
sub_filter_once off;
upstream backend {
server 128.128.100.202;
server 128.128.100.203;
server 128.128.100.29;
server 128.128.100.201;
hash $mail_server;
}
server {
listen 9090;
root jawstats;
access_log off;
location ~ .*\.php5?$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:10005;
fastcgi_index index.php;
}
location / {
index index.php;
}
}
server {
listen 80;
listen 443 default ssl;
ssl_certificate /usr/local/nginx/conf/gateway.cert;
ssl_certificate_key /usr/local/nginx/conf/gateway.key;
server_name testgateway.corp.shkp.com.hk;
server_tokens off;
proxy_temp_path /var/iNotes/temp;
client_max_body_size 20m;
if ( $http_cookie ~* "mail_server=([^;]+)(?:;|$)" ){
set $mail_server $1;
}
location = /names.nsf {
proxy_pass http://shkcorpms1.corp.shkp.com.hk;
}
location ~ .*\.php5?$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:10005;
fastcgi_index index.php;
}
location ~ \(\$(All|Inbox|Sent)\)/ {
proxy_set_header Accept-Encoding "";
proxy_pass http://backend;
}
location / {
index index.php;
if ( $uri ~ ".*\.(gif|jpg)" ) {
root /var/iNotes/$host;
expires max;
error_page 404 = /fetch$uri;
break;
}
proxy_pass http://backend;
root html;
}
location /fetch {
internal;
proxy_pass http://backend;
proxy_store on;
proxy_store_access user:rw group:rw all:rw;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Via "nginx";
alias /var/iNotes/$host;
}
location /nginx_status {
stub_status on;
access_log off;
allow 172.16.0.0/16;
deny all;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment