Nginx redirection-Have read webserver docs and forums but not much written

NethServer Version: NS8
Module: webserver

Hi,
I have gone over the webserver github pages and read as much as I can find in the forums regarding wordpress/apache .htaccess and url redirection.

From the Github:

nginx

  • add a dyn-9001.custom to /home/webserver1/.config/state/conf.d/
  • vim /home/webserver1/.config/state/conf.d/dyn-9001.custom and write a valid nginx configuration
  • set the file ownership to webserver1 : chown webserver1:webserver1 /home/webserver1/.config/state/conf.d/dyn-9001.custom
    But this doesn’t work with location
location / {
            try_files $uri $uri/ /index.php?$args; 
}

or similar, logs complain about duplicate location /.
I tried without the location / (used only try_files $uri $uri/ /index.php?$args;) and permalinks don’t work. Obviously this is a common issue with migration from NS7 to NS8 webserver so can the github page please be updated with a simple solution as I’m wondering how to overcome. Modifying the dyn-900x.conf files of course doesn’t work.

I’ve put up with several websites having terrible link references for almost year and was hoping someone would explain sometime what I am missing. But so far no luck :slight_smile:, With customers now wanting to use wp staging this is getting to the “throw the baby out with the bathwater stage” and put in a proxmox VM apache server to overcome this very common issue.

Any help or insights I’ve missed would be much appreciated.

Matthew

Hi

Stephdl made a LAMP module - with Apache, MariaDB and PHP…

:slight_smile:

My 2 cents
Andy

1 Like

I saw that Andy, but was hoping I could stick with the webserver module, otherwise why have it at all :slight_smile: I’ve put together LAMP units myself, and have used them on windows for testing but I was really hoping the webserver module would be fixed. Otherwise it’s like having a Swiss army knife without a working cork screw

NS7 used LAMP, not nginx…

1 Like

Yes and worked well except with permission issues sometimes. Easy enough to fix. Maybe I’ll be redoing three servers over Christmas again :frowning:

Just looked at Stephdl’s LAMP module. Okay will give that a go. It looks very promising. Saves me making up a few servers. :slight_smile:
ns8-lamp <==== Go check out :slight_smile: :slight_smile: :slight_smile:

1 Like

not sure to understand but if you want a reverse proxy, just use the http route setting of cluster -admin, traefic will handle the reverse proxy part

1 Like

Hi Stephdl,

Thanks for the reminder. I’m very used to using the http routes. I have quite a few VMs running ERPNext, MeshCentral, Envoy Power Control etc. :slight_smile: all using the letsencrpyt feature as our local hosting providers don’t offer DNS api. It’s great now nethServer has the ignore remote certificate option in place.

Have a fantastic night,

Matthew
PS I actually need the uri rewrite working in the nginx webserver containers for WordPress permalinks but can’t crack the syntax.

ns8-lamp use apache, webserver nginx, it should be common, find the good upstream documentation

Here it is day light, I always loved timezone :stuck_out_tongue:

nginx is exactly my issue with nethserver webserver app. I’ve been trying to configure the 9002-dyn.custom file so it applies

location / {
  try_files $uri $uri/ $uri.html $uri.php /index.php?q=$uri&$args;
}

I keep getting a duplicate block error, and without the location part it doesn’t seem to do anything. I’ve also tried similar options but I’m always getting the dreaded 404 error when enabling permalinks in WordPress. I bet it’s something simple I’m missing lol :rofl::rofl::rofl:

Yep, nginx does what you asked, not sure webserver is in cause