Welcome! Log In Create A New Profile

Advanced

Error in proxying, multiple locations, multiple destinations

Posted by rjchute 
Error in proxying, multiple locations, multiple destinations
August 30, 2011 11:04AM
I have an Apache config which works perfectly, and tried to emulate it in nginx, however it only partially works. The first location /authenticate/ { } directive works fine, but the second location /cas/ { } directive times out, causing nginx to return an error to the browser. From the command line on the server I can manually retrieve http://10.8.120.10:5447/ with no difficulty, and as mentioned, the apache config works perfectly.

Apache Config:

Listen 5510
NameVirtualHost *:5510
<VirtualHost *:5510>
RewriteEngine on
RewriteRule ^/theme/(.+)$ /director2/theme/$1 [P]
RewriteRule ^/yui_2.7.0/(.+)$ /director2/yui_2.7.0/$1 [P]
RewriteRule ^/js/(.+)$ /director2/js/$1 [P]

ProxyPass /authenticate/ http://10.8.120.10/
ProxyPassReverse /authenticate/ http://10.8.120.10/

ProxyPass /cas/ http://10.8.120.10:5447/
ProxyPassReverse /cas/ http://10.8.120.10:5447/

ProxyPass /director2/ http://10.8.120.10:5449/
ProxyPassReverse /director2/ http://10.8.120.10:5449/

ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined

SSLEngine on
SSLCertificateFile /etc/nginx/ssl/xxx.crt
SSLCertificateKeyFile /etc/nginx/ssl/xxx.key

<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
BrowserMatch "MSIE [2-6]" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
BrowserMatch "MSIE [7-9]" ssl-unclean-shutdown
</VirtualHost>



nginx config:

server {

listen 5510;
server_name localhost;

access_log /var/log/nginx/access.airfire-test.log;

ssl on;
ssl_certificate /etc/nginx/ssl/xxx.crt;
ssl_certificate_key /etc/nginx/ssl/xxx.key;
ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
ssl_prefer_server_ciphers on;

location / {
root /var/www;
index index.html;
}
location /authenticate/ {
proxy_pass http://10.8.120.10:80/;
}
location /cas/ {
proxy_pass http://10.8.120.10:5447;
}
location /director2/ {
proxy_pass http://10.8.120.10:5449/;
}
location /theme/ {
proxy_pass http://10.8.120.10:5449/theme/;
}
location /yui_2.7.0/ {
proxy_pass http://10.8.120.10:5449/yui_2.7.0/;
}
location /js/ {
proxy_pass http://10.8.120.10:5449/js/;
}
}


Any insight into any errors I might have in my nginx config would be greatly appreciated, or if there is a deeper problem in nginx that I can explore. Thanks!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 115
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready