# Nginx and WordPress custom permalink not working

**URL:** <https://forum.virtualmin.com/t/nginx-and-wordpress-custom-permalink-not-working/125450>\
**Category:** Virtualmin\
**Created:** [March 14, 2024, 3:55am UTC](https://forum.virtualmin.com/t/nginx-and-wordpress-custom-permalink-not-working/125450 "2024-03-14T03:55:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aryan](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/aryan/32/13703_2.png) [@aryan](https://forum.virtualmin.com/u/aryan)\
**Post date:** [March 14, 2024, 3:55am UTC](https://forum.virtualmin.com/t/nginx-and-wordpress-custom-permalink-not-working/125450/1 "2024-03-14T03:55:04Z")

</div>

| SYSTEM INFORMATION | |
| --- | --- |
| OS type and version | Ubuntu 22.04 |
| Webmin version | 2.105 |
| Virtualmin version | 7.9.0 |

Just installed Virtualmin LEMP stack on ubuntu server and when i tried changing the permalink, it start showing error on other pages. i followed [VirtualMin WordPress Nginx Permalinks 404 [Solved] - Nabtron](https://nabtron.com/virtualmin-wordpress-nginx-permalinks-404/) and added this

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

```

However, it was mentioned that the settings will get wiped out with upgrade. How to keep it working? Why it is not being added natively with WordPress script installation?

Thanks

---

<div class="post-metadata">

**Author:** ![revinas](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/revinas/32/13712_2.png) [@revinas](https://forum.virtualmin.com/u/revinas)\
**Post date:** [March 14, 2024, 8:57am UTC](https://forum.virtualmin.com/t/nginx-and-wordpress-custom-permalink-not-working/125450/2 "2024-03-14T08:57:51Z")

</div>

I was about to write the same thing. I use virtualmin with nginx for years and the only solution to that is to manually edit each site and add the above segment to nginx. I avoid to upgrade.

---

<div class="post-metadata">

**Author:** ![aryan](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/aryan/32/13703_2.png) [@aryan](https://forum.virtualmin.com/u/aryan)\
**Post date:** [March 15, 2024, 3:04pm UTC](https://forum.virtualmin.com/t/nginx-and-wordpress-custom-permalink-not-working/125450/3 "2024-03-15T15:04:44Z")

</div>

Tried using a **new vps with almalinux 9** which seems to have less issues. However i don’t see separate .conf file path for each domain with this system

`/etc/nginx/sites-available/`

All i see a single nginx.conf which have the rules for domains. i can use above code which may work globally for all domains but what about the subfolders? this following code need to be added for each?

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

```

here /wordpress is the folder.  
Remember that this modified nginx.conf will reset with the upgrade so that is the another issue.  
wonder if the official devs help with this.

---

<div class="post-metadata">

**Author:** ![aryan](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/aryan/32/13703_2.png) [@aryan](https://forum.virtualmin.com/u/aryan)\
**Post date:** [March 16, 2024, 4:27pm UTC](https://forum.virtualmin.com/t/nginx-and-wordpress-custom-permalink-not-working/125450/4 "2024-03-16T16:27:12Z")

</div>

Hi buddy, the recent update with virtualmin script have the fix, could you check and confirm?

source: [Nginx and WordPress custom permalink not working · Issue #2105 · webmin/webmin · GitHub](https://github.com/webmin/webmin/issues/2105)

---

<div class="post-metadata">

**Author:** ![revinas](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/revinas/32/13712_2.png) [@revinas](https://forum.virtualmin.com/u/revinas)\
**Post date:** [April 6, 2024, 7:22am UTC](https://forum.virtualmin.com/t/nginx-and-wordpress-custom-permalink-not-working/125450/5 "2024-04-06T07:22:51Z")

</div>

I’m sorry not checked yet cause busy of other jobs now. i will install from scratch on another server and test later.

---

<div class="post-metadata">

**Author:** ![myleslasco](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/myleslasco/32/12015_2.png) [@myleslasco](https://forum.virtualmin.com/u/myleslasco)\
**Post date:** [April 6, 2024, 4:14pm UTC](https://forum.virtualmin.com/t/nginx-and-wordpress-custom-permalink-not-working/125450/6 "2024-04-06T16:14:58Z")

</div>

Probably not useful here, but I just wanted to say, after working with nginx and wordpress I’ve gone back to apache. If you have additional users / sites Nginx becomes a pain in the ass. At least… for me it just caused problems and I got tired of workarounds.

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [June 5, 2024, 4:15pm UTC](https://forum.virtualmin.com/t/nginx-and-wordpress-custom-permalink-not-working/125450/7 "2024-06-05T16:15:15Z")

</div>

Closed on June 5, 2024, 4:15pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
