<![CDATA[ FURLs not working after upgrade (2.1.3-pl) - My Forums]]> https://forums.modx.com/thread/?thread=70163 <![CDATA[Re: FURLs not working after upgrade (2.1.3-pl)]]> https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl?page=2#dis-post-394653 NOTE: This above solution may become problematic when you _don't_ want HTTPS set to "on".

By adjusting to the following, you can essentially "set it and forget it":

Place in the "http" context:

map $scheme $php_https { default off; https on; }


See: http://wiki.nginx.org/HttpMapModule

Then, in your fastcgi_params include, simply reference your new map variable via:

fastcgi_param HTTPS $php_https;


:) (Thx kolbyjack in #nginx)]]>
pixelchutes Sep 23, 2011, 04:56 PM https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl?page=2#dis-post-394653
<![CDATA[Re: FURLs not working after upgrade (2.1.3-pl)]]> https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl?page=2#dis-post-394623
(Not sure if it's related, but thought I'd check here....)

@Roland, thanks for posting the nginx conf ... good use of try_files and @modx upstream to preserve GET vars. Well done!

UPDATE:

Should have thought of this sooner! Simply disabled "Strict URLs" Plugin, and voila! "redirect loop" went away.... (We have our culprit! wink)

UPDATE 2:

This issue only showed up as a result of "forced HTTPS" -- Turns out that $_SERVER['HTTPS'] was _not_present in this nginx/php-fpm build $_SERVER vars, while it was there for original Apache setup...

This resulted in the condition (http://domain.com != https://domain.com) always equating "false", and forcing the redirect (loop) to the HTTPS strict URL.

The following nginx config adjustment did the trick:

fastcgi_param HTTPS on;

]]>
pixelchutes Sep 23, 2011, 02:34 PM https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl?page=2#dis-post-394623
<![CDATA[Re: FURLs not working after upgrade (2.1.3-pl)]]> https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl?page=2#dis-post-394614
As I honestly am not skilled with this server stuff but I suspect others may be looking for this topic at a later stage I linked to it from the Nginx Server Config documentation as an alternative.]]>
markh Sep 23, 2011, 01:43 PM https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl?page=2#dis-post-394614
<![CDATA[Re: FURLs not working after upgrade (2.1.3-pl)]]> https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl?page=2#dis-post-394442
That did it.

Thanks a lot for the config.]]>
towerofbabel Sep 22, 2011, 01:59 PM https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl?page=2#dis-post-394442
<![CDATA[Re: FURLs not working after upgrade (2.1.3-pl)]]> https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl?page=2#dis-post-394224 Some config changes (i use a similiar config for a modx revo site):

server {
	listen 80;
	server_name www.financetrails.com financetrails.com;
	root /path/to/www.financetrails.com;
	index index.php index.html;

	location / {
		#try to get file directly, try it as a directory or fall back to modx
		try_files $uri $uri/ @modx;
	}

	location @modx {
		#including ? in second rewrite argument causes nginx to drop GET params, so append them again
		rewrite ^/(.*)$ /index.php?q=$1&$args;
	}

	location ~ \.php(.*)$ {
		include fastcgi_params;
		fastcgi_pass backend;
		fastcgi_index index.php;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
	}
}


also make sure you have

cgi.fix_pathinfo=0


inside your php.ini, otherwise you might be susceptible to attacks via uploaded php files.]]>
rfirmont Sep 21, 2011, 11:58 AM https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl?page=2#dis-post-394224
<![CDATA[Re: FURLs not working after upgrade (2.1.3-pl)]]> https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl#dis-post-394179 Of course, this thread is 10 days old, so you may have already done this…]]> leeboone Sep 21, 2011, 08:09 AM https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl#dis-post-394179 <![CDATA[Re: FURLs not working after upgrade (2.1.3-pl)]]> https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl#dis-post-394130
Yes, I got the config from there.]]>
towerofbabel Sep 21, 2011, 02:05 AM https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl#dis-post-394130
<![CDATA[Re: FURLs not working after upgrade (2.1.3-pl)]]> https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl#dis-post-393986 Reports -> Error Log

I'm honestly not into server stuff much, and that server config means nothing to me, lol.

Looks like you got it from here right? http://rtfm.modx.com/display/revolution20/Nginx+Server+Config]]>
markh Sep 20, 2011, 06:25 AM https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl#dis-post-393986
<![CDATA[Re: FURLs not working after upgrade (2.1.3-pl)]]> https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl#dis-post-393860
No errors in the nginx error log.

I have reinstalled the original working-gr8-on-apache application on the new machine, with no upgrade to MODX.

The behaviour is now slightly different to how I described earlier, but the end result is that URL rewriting is not working. What I see:

* everything works great with FURLs turned off in MODX.
* If I turn FURLs on, the links are generated correctly in the HTML (eg, "/features/" instead of "index.php?whatever"), but those links do not resolve to the correct pages - they just return me the home page.

Here is my nginx config:


server
{
listen 80;
server_name www.financetrails.com financetrails.com;
root /path/to/www.financetrails.com;
index index.php;

location / {
root /path/to/www.financetrails.com;
index index.php index.html;

# This is the important part - map any extension of
# /blahblahblah that doesn't exist to index.php

if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?q=$1 last;
}
}

location ~ \.php(.*)$ {
include fastcgi_params;
fastcgi_pass backend;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

}
]]>
towerofbabel Sep 19, 2011, 08:25 AM https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl#dis-post-393860
<![CDATA[Re: FURLs not working after upgrade (2.1.3-pl)]]> https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl#dis-post-393154
Whenever I noticed friendly urls are not being generated it is cause of some URI issues, which could very well be caused by a different move/upgrade method than suggested. Luckily the error log usually notifies you of that though, by filling up a bit on every request.]]>
markh Sep 12, 2011, 09:04 PM https://forums.modx.com/thread/70163/furls-not-working-after-upgrade-2-1-3-pl#dis-post-393154