Welcome! Log In Create A New Profile

Advanced

Wordpress/Unbounce on nginx

Posted by pdxITgirl 
Wordpress/Unbounce on nginx
September 17, 2018 03:07PM
Hello everyone,

I hope this is the right forum for this, as it relates to settings given for Apache that need translated to nginx configuration syntax.

So our corporate website is running on a server I control, which runs Wordpress on nginx. One of the departments needs Marketing to run some ads that use the Unbounce plugin for landing pages, which doesn't allow direct URLs to external sites without a modification to our nginx configuration. Without it, Wordpress tries to handle the URL redirect instead of passing the complete URL to Unbounce to handle. The visitor is returned with a 404. Unbounce has just been telling me to 'make it not 404' with nginx. Which clearly isn't very helpful.

So their tech support told me it would work if I 'just used the default Wordpress .htaccess.' After quite a bit of pressuring, they gave me a configuration code block that they think should work, but I am unable to figure out how to use it. I'm much more familiar with Apache, but need to make this work in nginx. But realistically, it looks more like a general idea of what they're looking for than actual an nginx config block. This is where my unfamiliarity with nginx blocks me, and if I had time to just learn it, I would but I'm under the gun timewise.

So below is the code block they gave me:

'/<page>/clkn' --> '<wpserver>/<page>/clkn' (click - non-conversion goal)
'/<page>/clkg' --> '<wpserver>/<page>/clkg' (click - conversion goal)
'/<page>/fsg' --> '<wpserver>/<page>/fsg' (form submission - conversion goal)
'/<page>/fsn' --> '<wpserver>/<page>/fsn' (form submission - non-conversion goal)


So basically I think they're telling me I need to add a config block to tell it to add the site's URL as a FQDN to the links that end in /clkn, /clgk, /fsg, and /fsn. So for example, if the landing page URL is http://mysite.com and the landing page is landingpage, they would want it to look for /landingpage/clkn and replace it with https://mysite.com/landingpage/clkn, I think. I'm not really sure.

Or, perhaps, it's easier to just throw in the Apache .htaccess equivalent into the config file? Either way, I believe these would go into a <location> block, which I don't make use of in my nginx configs, so I need to add that as well somehow. I assume pointing to the root of the Wordpress install? If it would help, I can post a copy of my current config file, sanitized for sensitive information.

I've searched various forums, and have seen one or two others with the same question, but nobody responded. I saw other types of questions, but weren't sure if they were relevant or not. I didn't see anything here in the nginx forums that I could make use of.

Any help with this would be immensely appreciated!!


Thanks,

pdxITgirl
Re: Wordpress/Unbounce on nginx
September 17, 2018 05:09PM
https://www.thegeekstuff.com/2017/08/nginx-rewrite-examples/
https://stackoverflow.com/questions/4329316/how-to-write-a-url-rewrite-in-nginx

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: Wordpress/Unbounce on nginx
September 19, 2018 05:50PM
Thanks for the links.

I had been hoping to figure out how to get it to do what Unbounce wanted, but it doesn't look like that's possible so I had to manually write rewrite rules for each landing page explicitly, and I placed them in the site's nginx config file. I was hoping to avoid manual rewrite rules and get Unbounce to handle it like it's supposed to, but I couldn't figure out how to get it to work. I'm thinking it's just incompatible with the more complex Wordpress installs, based on the Unbounce help files and what it's doing.

Thanks for your time
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 69
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready