Why is nginx redirecting requests on port 8080 to port 80(apache) (2 posts)

  1. slipstream-ed
    Posted 1 year ago #

    I have a wordpress blog setup on apache2 (port 80) on Ubuntu 12.04, I also have a nginx setup listening on port 8080 serving the same blog. My problem is, whenever I try to open the blog on port 8080, nginx redirects the requests to apache which shouldn't happen. I'm posting the contents of /etc/nginx/sites-enabled/wordpress

    server {
        listen   8080;
        root /var/www;
        index index.php index.html index.htm;
        server_name foobartech.strangled.net:8080;
        location / {
                try_files $uri $uri/ /index.php?q=$uri&$args;
        location /doc/ {
                alias /usr/share/doc/;
                autoindex on;
                deny all;
        error_page 404 /404.html;
        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
                root /usr/share/nginx/www;
        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
                fastcgi_param   SERVER_PORT 8080;
                port_in_redirect off;

    I have also set cgi.fix_pathinfo=0

    in /etc/php5/fpm/php.ini

  2. Pothi
    Posted 1 year ago #

    Why would you want to access your site on port 8080?

Topic Closed

This topic has been closed to new replies.

About this Topic