Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx and WordPress custom permalink not working #2105

Closed
aryanrajseo opened this issue Mar 16, 2024 · 11 comments
Closed

Nginx and WordPress custom permalink not working #2105

aryanrajseo opened this issue Mar 16, 2024 · 11 comments

Comments

@aryanrajseo
Copy link

Hi, WordPress is the most popular cms and we are having issue setting up custom permalink with nginx webserver. As mentioned here https://forum.virtualmin.com/t/nginx-and-wordpress-custom-permalink-not-working/125450

With Ubuntu 22.04, we have separate domainname.conf file available in /etc/nginx/sites-available/

however with AlmaLinux 9, we hae a single nginx.conf file.

Adding the following code in .conf file works but will get wiped out with any upgrade.

location / { index index.php index.html index.htm; try_files $uri $uri/ /index.php$is_args$args; }

This code need to be added for each domain in Ubuntu server however for almalinux, it will required one time for domains but for Installations made on SUBFOLDER, it single .conf file will make it more difficult to manage.

Wonder if you could offer a fix as the issue is very genuine. A global variable fix to detect the WordPress install and addd the rule or fix the permalink issue.

@chris001
Copy link

To protect from nginx upgrades wiping out nginx.conf and all your website configs in it, you should answer No when it asks you if you want to upgrade the nginx.conf file with the default file from the new version.

You can also protect your website .conf by including them, like in ubuntu:

http {
    …
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}

More:
https://serverfault.com/questions/527630/difference-in-sites-available-vs-sites-enabled-vs-conf-d-directories-nginx

@aryanrajseo
Copy link
Author

hi @chris001 appreciate the help. could you also confirm the same for Almalinux 9 and why it not have nginx webserver backup module?

@jcameron
Copy link
Collaborator

@iliajie weren't you looking into a fix for this recently?

@aryanrajseo
Copy link
Author

I would also appreciate that if it not required to add any additional code in .conf file in new upgrade as we install WordPress on different folders. for staging and demo sites. A global variable rule which detect the WordPress custom permalink changes in nginx webserver would bring more users to switch from expensive control panels. I know it could take more time but trust me, it will be worth because webmin/virtualmin is very powerful but have some issues with nginx webserver/lemp stack.

@iliajie
Copy link
Collaborator

iliajie commented Mar 16, 2024

@iliajie weren't you looking into a fix for this recently?

Yes, we fixed that on Virtualmin WordPress installer script.

@aryanrajseo
Copy link
Author

Yes, we fixed that on Virtualmin WordPress installer script.

Hi, i installed LEMP stack with Ubuntu 22.04 and Almalinux 9 yesterday and the WordPress custom permalink was not working. is the fix released?

@iliajie
Copy link
Collaborator

iliajie commented Mar 16, 2024

When you install Virtualmin, you might not immediately receive the latest updates for install scripts; this can typically take up to 24 hours. I suggest that if you create a new test domain and attempt to install WordPress again, it should work properly.

@aryanrajseo
Copy link
Author

aryanrajseo commented Mar 16, 2024

hi @iliajie thank you, i see the install script now also have username and password (autofilled) and it is working with subfolder too. have you got any reference from my recent forum post or the fix was already in the progress?

@iliajie
Copy link
Collaborator

iliajie commented Mar 16, 2024

The Nginx fix was incorporated a few months ago.

@aryanrajseo
Copy link
Author

aryanrajseo commented Mar 16, 2024

awesome. thank you for working on this in such a short time. I really appreciate it. I wish more hosting provider switch to webmin/virtualmin. i am very happy that i given this a try, it was boring at first but i am in love with it now. there are few things that need some improvements but it is almost pretty perfect lightweight control panel.

thanks again.

@iliajie
Copy link
Collaborator

iliajie commented Mar 16, 2024

You're welcome! If you see anything that could be improved, just open a new GitHub ticket, and we'll have a closer look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants