Hi All
Im replacing apache with ngix and have been truing to get it working for several hours
I m using tomcat as a backend and have 2 virtual hosts and SSL.
My first problem is that tomcat is returning a 500 "internal server error" and nginx replies with a "400 bad request"
here is my config:
[code]
user apache; # should be www or nginx
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_proxied any;
gzip_vary on;
gzip_types text/plain application/xml application/json text/javascript text/css;
# BETA
server {
listen 80;
server_name www.beta.mydomain.com www01.beta.mydomain.com www02.beta.mydomain.com;
location ~ ^/(images|javascript|js|css|flash|media|static)/ {
root /html/beta/www/;
access_log off;
expires 30d;
}
location / {
root /html/beta/www/;
index index.html index.htm index.cfm index.cfml;
proxy_pass http://beta.localhost:8001;
# proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
# redirect server error pages to the static page /50x.html
# error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# root html;
# }
location ~ /\.svn {
deny all;
}
}
# LIVE
server {
listen 80;
server_name www.mydomain.com www01.mydomain.com www02.mydomain.com;
location ~ ^/(images|javascript|js|css|flash|media|static)/ {
root /html/live/www/;
access_log off;
expires 30d;
}
location / {
root /html/live/www/;
index index.html index.htm index.cfm index.cfml;
proxy_pass http://localhost:8001;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
# redirect server error pages to the static page /50x.html
# error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# root html;
# }
location ~ /\.svn {
deny all;
}
}
# HTTPS LIVE
server {
listen 443;
server_name www.mydomain.com www01.mydomain.com www02.mydomain.com;
ssl on;
ssl_certificate cert.pem;
ssl_certificate_key server.key;
# ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers HIGH:!SSLv2:!ADH:!aNULL:!eNULL:!NULL;
# ssl_prefer_server_ciphers on;
location ~ ^/(images|javascript|js|css|flash|media|static)/ {
root /html/live/www/;
access_log off;
expires 30d;
}
location / {
root /html/live/www/;
index index.html index.htm index.cfm index.cfml;
proxy_pass http://localhost:8001;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
# redirect server error pages to the static page /50x.html
# error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# root html;
# }
location ~ /\.svn {
deny all;
}
}
}
[/code]
at the moment im just testing www02.beta.mydomain.com if do a beta.localhost:8001 I get a "500 internal server" error (this is expected) but when i tri the full url I get "400 bad request"
Regards
GX
Edited 1 time(s). Last edit at 01/13/2011 01:01AM by mailme_gx.