Hi all,
I have a problem with the nginx configuration. I want nginx (http://mydomain.com/redmine) to be a proxy for mongrel (http://127.0.0.1:8000) but I get a routing error from mongrel because nginx is requesting http://127.0.0.1:8000/redmine. I am running nginx 0.7.65 on Debian Lenny and here is my configuration file :
[code]user www-data;
worker_processes 4;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
access_log /var/log/nginx/access.log;
sendfile on;
tcp_nopush on;
resolver XXX.XXX.XXX.XXX;
keepalive_timeout 3;
tcp_nodelay off;
gzip on;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
proxy_redirect off;
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;
server {
listen 443;
ssl on;
ssl_certificate /etc/ssl/certs/mycert.pem;
ssl_certificate_key /etc/ssl/private/mykey.pem;
server_name mydomain.com;
root /data/httpsdocs;
index index.php index.html index.htm;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log info;
location ^~ /redmine {
alias /data/redmine/public;
try_files $uri/index.html $uri.html $uri @mongrel;
}
location @mongrel {
proxy_pass http://127.0.0.1:8000;
}
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ {
access_log off;
expires 30d;
}
}
}[/code]
If someone has the solution it would be great ;) Thanks a lot.
Edited 1 time(s). Last edit at 05/22/2010 09:46PM by [HellR].