Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have got nginx to reverse proxy any requests to dev.example.com to apache. It all works fine, and I installed wordpress on the url "dev.example.com/wordpress/". The weird thing is that if you type in the url "dev.exmaple.com/wordpress" you get a connection timed out error, but if you type in "dev.exmaple.com/wordpress/" with the trailing slash, it connects fine. Why does it do this?

edit: sorry here is the nginx config

server{
    server_name dev.example.com;
    location / {
            proxy_pass http://127.0.0.1:8078;
            proxy_set_header   Host             $host;
            proxy_set_header   X-Real-IP        $remote_addr;
            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
            proxy_max_temp_file_size 0;

            client_max_body_size       10m;
            client_body_buffer_size    128k;

            proxy_connect_timeout      90;
            proxy_send_timeout         90;
            proxy_read_timeout         90;

            proxy_buffer_size          4k;
            proxy_buffers              4 32k;
            proxy_busy_buffers_size    64k;
            proxy_temp_file_write_size 64k;
    }
}

I copied most of that from somewhere, not sure where...

for apache, all I did was change

NameVirtualHost *:8078
Listen 8078

in the ports.conf file.

I also editied sites-available/default and put

<VirtualHost *:8078>

on the top instead of

<VirtualHost *:80>

This is all on ec2 (ubuntu).

share|improve this question
    
Show you nginx config. –  AlexD Aug 23 '11 at 6:05
    
Please post your Apache and nginx configuration files? –  quanta Aug 23 '11 at 6:08

1 Answer 1

Without the trailing slash you are trying to be redirected, you should set a proxy_redirect sentence to resolve the issue. For example:

proxy_redirect http://localhost:8078/ http://dev.example.com/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.