• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Nginx missing trailing slash tries to redirect...

Slavik

Basic Pleskian
Just ran into a particularly strange issue: some urls without trailing slashes aren't being redirected properly. An example:

http://jkhub.org/area51/ works fine
http://jkhub.org/area51 redirects to http://jkhub.org:7080/area51/ before deciding that's unreachable because of the port being added
However, http://jkhub.org/area51/forum/5-introductions redirects to http://jkhub.org/area51/forum/5-introductions/ fine...

http://gunslingersacademy.com/forum/ works fine. http://gunslingersacademy.com/forum tries to redirect to http://gunslingersacademy.com:7080/forum/ and fails horribly

http://caelish.com/dev/ works fine. http://caelish.com/dev tries to redirect to http://caelish.com:7080/dev/ and fails horribly

You see the trend.

Suggests?
 
That is still a default problem with Nginx. You would have to manipulate the default nginx template file to remove the port 7080 but again I would *i think rather wait for the update to resolve that problem.
 
paulieG answered this on a previous thread.

http://forum.parallels.com/showpost.php?p=628891&postcount=8

He left this one out. After completing all of that you need to run the following command.

/usr/local/psa/admin/bin/httpdmng --reconfigure-all

Reading what he posted there works as a temporary solution and when Nginx gets fixed you can easily just delete the custom directory and run a reconfigure--all command again to bring it back to normal configuration without the changes made.
 
paulieG answered this on a previous thread.

http://forum.parallels.com/showpost.php?p=628891&postcount=8

He left this one out. After completing all of that you need to run the following command.

/usr/local/psa/admin/bin/httpdmng --reconfigure-all

Reading what he posted there works as a temporary solution and when Nginx gets fixed you can easily just delete the custom directory and run a reconfigure--all command again to bring it back to normal configuration without the changes made.

Perfect.

TYVM.
 
Exactly the same problem since plesk 11 upgrade but i don't use Nginx.
mydomain.com/forum/ works
mydomain.com/forum try to redirect to mydomain.com:7080/forum/

Anyone got the fix?
 
Yes i seen it, but what file i have to edit if i don't use Nginx?
Thank you
 
creat
/usr/local/psa/admin/conf/templates/custom/
/usr/local/psa/admin/conf/templates/custom/domain/

Edit /usr/local/psa/admin/conf/templates/custom/domain/domainVirtualHost.php file

remove
:<?php echo $OPT['ssl'] ? $VAR->server->webserver->httpsPort : $VAR->server->webserver->httpPort ?>
line 6
to only get
ServerName "<?php echo $VAR->domain->asciiName ?>"

line 132 add
<?php if ($VAR->server->webserver->proxyActive) echo "UseCanonicalName On\nUseCanonicalPhysicalPort Off\n"; ?>

used

/usr/local/psa/admin/bin/httpdmng --reconfigure-all

Still not working on my non-Nginx server
 
Hi sébastienB,

I'm afraid if you're getting redirects to port 7080 then you're definitely using nginx (Assuming its your server and you've made no changes).

If you have root access type the command : lsof -i tcp:80

That'll tell you what processes are listening on port 80 and they are more than likely nginx.

To disable nginx go into Services Management (Tools and Settings or Server) and turn off nginx, Plesk will then rebuild all your configuration files for Apache and put it back onto port 80.

The only other possibility is that somehow you're running Apache on both port 80 and port 7080, which would be a little odd.

paul.
 
@paulieG

I tried to disable nginx and it works so far - apache is running fine ...

But:

In the time of testing nginx some installations of wordpress have been created.
Now there is the problem that the database contains the URL with :7080 in it.

Every link in the database- not even "site url" and "home url" - urls of pictures and so on.
So I get 404 results for these pages.

Don´t know if it is as hard as it seems to be to fix the problem with nginx instead of stopping this service and clean up of script databases.


Additional in this thread my official error report:

--- --- --- --- ---
PRODUCT, VERSION, MICROUPDATE, OPERATING SYSTEM, ARCHITECTURE

Plesk 11.0.9 #MU5 - Debian 6.0.4 64bit

PROBLEM DESCRIPTION

sub folder navigation shows port 7080

STEPS TO REPRODUCE

www.example.org shows www.example.org
www.example.org/wordpress shows www.example.org:7080/wordpress

ACTUAL RESULT

port 7080 shown in browser

EXPECTED RESULT

don´t know - first step should be that the port doesn´t appear in the browser

ANY ADDITIONAL INFORMATION

same problem on different servers, but same OS and Plesk version
--- --- --- --- ---
 
Hi sébastienB,

I'm afraid if you're getting redirects to port 7080 then you're definitely using nginx (Assuming its your server and you've made no changes).

If you have root access type the command : lsof -i tcp:80

That'll tell you what processes are listening on port 80 and they are more than likely nginx.

To disable nginx go into Services Management (Tools and Settings or Server) and turn off nginx, Plesk will then rebuild all your configuration files for Apache and put it back onto port 80.

The only other possibility is that somehow you're running Apache on both port 80 and port 7080, which would be a little odd.

paul.


Fixed, Really many many thanks,

I didn't know why but a nginx rpm was enable on my fresh centos installation : sw-nginx-1.3.0-1.12051815.centos6.x86_64

I removed it then followed your instructions + clean browser cache and all working fine now.

Also try to test nginx with a yum install nginx then http://forum.parallels.com/showpost.php?p=628891&postcount=8
It fix :7080 problem but www.mydomain.com/forum was redirect to mydomain.com/forum (without www).
 
Incorrect Syntax for Reconfigured in KB Article

Igor, it's worth noting that kb article has the reconfigure syntax spelled incorrectly, which obviously isn't going to yield the desired result.

It should be: # /usr/local/psa/admin/bin/httpdmng --reconfigure-domain <domain_name>

NOT

# /usr/local/psa/admin/bin/httpmng --reconfigure-domain <domain_name>

I imagine most people are running vhosts, in which case they should do:
# /usr/local/psa/admin/bin/httpdmng --reconfigure-all

Clearly you know that, but those Googling may not.

That "d" makes a big difference. :)
 
Last edited by a moderator:
Just ran into a particularly strange issue: some urls without trailing slashes aren't being redirected properly. An example:

http://jkhub.org/area51/ works fine
http://jkhub.org/area51 redirects to http://jkhub.org:7080/area51/ before deciding that's unreachable because of the port being added
However, http://jkhub.org/area51/forum/5-introductions redirects to http://jkhub.org/area51/forum/5-introductions/ fine...

http://gunslingersacademy.com/forum/ works fine. http://gunslingersacademy.com/forum tries to redirect to http://gunslingersacademy.com:7080/forum/ and fails horribly

http://caelish.com/dev/ works fine. http://caelish.com/dev tries to redirect to http://caelish.com:7080/dev/ and fails horribly

You see the trend.

Suggests?

Yes i know this problem, i have reported this problem a month a go to the development team of Parallels.
Into the coming weeks should be there a fix for this problem. Hopefully the development team haves a correct answer for you.
 
Igor, it's worth noting that kb article has the reconfigure syntax spelled incorrectly, which obviously isn't going to yield the desired result.

That "d" makes a big difference. :)

Thank you! I have corrected article.
 
Back
Top