Skip to content

Instantly share code, notes, and snippets.

@bizmate
Created April 18, 2016 13:10
Show Gist options
  • Save bizmate/bfa467266c1d79561edcacf60bb38e08 to your computer and use it in GitHub Desktop.
Save bizmate/bfa467266c1d79561edcacf60bb38e08 to your computer and use it in GitHub Desktop.
worker_processes 4;
http {
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
#access_log /logs/nginx/access.log;
#error_log /logs/nginx/error.log;
gzip on;
gzip_disable "msie6";
server {
listen 80 default_server;
root /v3;
location / {
proxy_pass http://localhost:8090;
proxy_redirect http://localhost:8090/ /;
proxy_set_header Host $host;
proxy_intercept_errors on;
error_page 404 = @v2;
}
location @v2 {
proxy_pass http://localhost:8091;
proxy_redirect http://localhost:8090/ /;
proxy_set_header Host $host;
}
}
server {
listen 8090;
root /v3/public;
index index.php index.html index.htm;
try_files $uri /$uri /index.php?$query_string;
location / {
try_files $uri $uri/ /index.php?$query_string;
root /v3/public;
add_header thisisfrom v3assets$document_root$fastcgi_script_name;
}
location ~ ^/.+\.php(/|$) {
fastcgi_pass phpv3:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
add_header thisisfrom v3dynamics$document_root$fastcgi_script_name;
}
}
server {
listen 8091;
root /var/www/html/public;
index index.php index.html index.htm;
try_files $uri /$uri /index.php?$query_string;
location / {
try_files $uri $uri/ /index.php?$query_string;
root /v2/public;
add_header thisisfrom v2assets$document_root$fastcgi_script_name;
}
location ~ ^/.+\.php(/|$) {
fastcgi_pass phpv2:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
add_header thisisfrom v2dynamics$document_root$fastcgi_script_name;
}
}
}
events {
worker_connections 768;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment