Note that there are some explanatory texts on larger screens.

plurals
  1. PORemoving port from nginx redirect
    primarykey
    data
    text
    <p>I'm having an issue where some redirects on a website have the proxy-pass port included, rendering them useless. My configuration is as follows:</p> <p>Physical server 1:</p> <pre><code>server { server_name example.com www.example.com; location / { proxy_pass http://1.1.1.1:50493; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host "example.com"; } } </code></pre> <p>Physical Server 2:</p> <pre><code>server { listen 50493; server_name example.com www.example.com; set_real_ip_from 1.1.1.1; root /var/www/example.com; index index.php index.htm index.html; location / { if ($http_host !~ "^example.com"){ set $rule_0 1$rule_0; } if ($rule_0 = "1"){ rewrite ^/(.*) http://example.com/$1 permanent; } rewrite /[^/]+/([0-9]+)-[^/]+.html http://example.com/showthread.php?t=$1 permanent; } location ~ .php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/example.com$fastcgi_script_name; include fastcgi_params; fastcgi_read_timeout 600s; fastcgi_buffer_size 512k; fastcgi_buffers 16 512k; } } </code></pre> <p>Generally, browsing works fine. The site is browsable as one expects. However some links that redirect (eg. after a login action), redirect to a link with the port 50493 included. So we get <a href="http://example.com:50493/index.php" rel="nofollow">http://example.com:50493/index.php</a> for example. That will not work. My question is, how do I remove the port?</p> <p>From what I can tell, the forum software takes the port from the php session port variable. I've tried setting port_in_redirect off but to no avail. If it helps, the issue highlighted here: <a href="http://kb.parallels.com/en/114425" rel="nofollow">http://kb.parallels.com/en/114425</a> is similar.</p> <p>Thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload