Welcome! Log In Create A New Profile

Advanced

Reverse proxy Coolkie and format js problem

Posted by gunz0 
Reverse proxy Coolkie and format js problem
May 12, 2011 12:10AM
I'm running two RAILS application here is the exemple code

upstream main_app {
server #PID ou 127.0.0.1:port
}

upstream sub_app {
server #PID ou 127.0.0.1:port
}

server {
add_header #Cache-Control "public, must-revalidate"; #private
expires #;
listen 80;

client_max_body_size 4G;
server_name www.domain.com;

keepalive_timeout 5;

root #path/to/main/app;

try_files $uri/index.html $uri.html $uri @mainapp;

location @mainapp {
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;
proxy_redirect off;
proxy_pass http://main_app;
}
location /mongrel1{
root #path/to/sub/app;
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;
proxy_redirect off;
proxy_pass http://sub_app;
}

i can access both apps but i'm experincing two issues with the SUB_APP

1- when i login/logout, create cookies it give a text/html output for my set cookie attempt

2- It return me 404 error when I call a ''page.js'' (format js)...

How can i modify my conf to solve those issues?



Edited 2 time(s). Last edit at 05/12/2011 12:12AM by gunz0.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 90
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready