Proxy_pass and slash witch nginx
myckeul
nginx-forum at nginx.us
Fri May 20 00:37:38 MSD 2011
Hello,
Thanks for your response but they won't working.
Here is my conf :
nginx.conf :
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
# multi_accept on;
}
http {
include /etc/nginx/mime.types;
access_log /var/log/nginx/access.log;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
my vhost :
server {
listen [::]:80;
server_name proxy.com *.proxy.com;
access_log /var/log/nginx/proxy_.access.log;
error_page 404 = /404.htm;
location /404.htm {
root /var/www;
}
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
if ($host ~* ^proxy\.com$) {
proxy_pass http://mydomain.com;
}
if ($host ~* ^www\.proxy\.com$) {
proxy_pass http://www.mydomain.com;
}
if ($host ~* ^subdomain\.proxy\.com$) {
proxy_pass http://subdomain.mydomain.com;
}
proxy_redirect http://proxy.com/test http://proxy.com/test/;
}
}
and my proxy.conf file :
proxy_redirect off;
proxy_intercept_errors on;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
client_header_buffer_size 64k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 16k;
proxy_buffers 32 16k;
proxy_busy_buffers_size 64k;
Thanks for your help
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198964,199196#msg-199196
More information about the nginx
mailing list