Welcome! Log In Create A New Profile

Advanced

Re: configuration problem with subdomain and proxy_pass

November 23, 2011 07:32AM
Hi,

Small observation, from your configuration

http://subdomain.mydomain.com

Will initiate a request to

http://localhost:8080/subdomain/

and not

http://localhost:8080/subdomain

[notice the /] which you said works in the browser. You might want to check
that out.

Also, you can check out the tomcat's access logs to see what request you
got.

On Wed, Nov 23, 2011 at 4:52 PM, nicksoft <nginx-forum@nginx.us> wrote:

> Hi,
>
> I have a problem with configuration subdomains for nginx. I want to
> configure domains:
>
> mydomain.com (port 80) --> http://localhost:8080/
> www.mydomain.com (port 80) --> http://localhost:8080/
> subdomain.mydomain.com (port 80) --> http://localhost:8080/subdomain
>
>
> Tomcat listening at 8080 port on localhost. I have application
> 'subdomain' in tomcat webapps folder.
>
>
>
> This is my configuration file:
> ------------------------------------------------------
> server
> {
> listen 80;
> server_name mydomain.com;
>
> # Main location
> location /
> {
> proxy_pass http://127.0.0.1:8080/;
> 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 52m;
> client_body_buffer_size 128k;
>
> proxy_connect_timeout 3600;
> proxy_send_timeout 3600;
> proxy_read_timeout 90;
>
> proxy_buffer_size 4k;
> proxy_buffers 4 32k;
> proxy_busy_buffers_size 64k;
> proxy_temp_file_write_size 64k;
> proxy_cache_valid 5m;
> }
> }
>
> server
> {
> listen 80;
> server_name www.mydomain.com;
>
> # Main location
> location /
> {
> proxy_pass http://127.0.0.1:8080/;
> 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 52m;
> client_body_buffer_size 128k;
>
> proxy_connect_timeout 3600;
> proxy_send_timeout 3600;
> proxy_read_timeout 90;
>
> proxy_buffer_size 4k;
> proxy_buffers 4 32k;
> proxy_busy_buffers_size 64k;
> proxy_temp_file_write_size 64k;
> proxy_cache_valid 5m;
> }
> }
>
> server
> {
> listen 80;
> server_name subdomain.mydomain.com;
>
> # Main location
> location /
> {
> proxy_pass http://127.0.0.1:8080/subdomain/;
> 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 52m;
> client_body_buffer_size 128k;
>
> proxy_connect_timeout 3600;
> proxy_send_timeout 3600;
> proxy_read_timeout 90;
>
> proxy_buffer_size 4k;
> proxy_buffers 4 32k;
> proxy_busy_buffers_size 64k;
> proxy_temp_file_write_size 64k;
> proxy_cache_valid 5m;
> }
> }
> ------------------------------------------------------
>
>
> For this configuration http:/www.mydomain.com and http:/mydomain.com
> working very well, but subdomain.mydomain.com doesn't work (there is no
> response from server).
>
> Oh, and http://mydomain.com/subdomain in browser works well too.
>
>
> I will be grateful for your help.
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,218793,218793#msg-218793
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

configuration problem with subdomain and proxy_pass

nicksoft November 23, 2011 06:22AM

Re: configuration problem with subdomain and proxy_pass

faskiri.devel November 23, 2011 07:32AM

Re: configuration problem with subdomain and proxy_pass

nicksoft November 23, 2011 08:59AM

Re: configuration problem with subdomain and proxy_pass

nicksoft November 23, 2011 09:26AM

Re: configuration problem with subdomain and proxy_pass

nicksoft November 23, 2011 12:08PM

Re: configuration problem with subdomain and proxy_pass

nicksoft November 23, 2011 12:10PM

Re: configuration problem with subdomain and proxy_pass

nicksoft November 23, 2011 01:18PM

Re: configuration problem with subdomain and proxy_pass

Fasihullah Askiri November 23, 2011 11:10AM

Re: configuration problem with subdomain and proxy_pass

faskiri.devel November 23, 2011 12:18PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 106
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