1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 question about nginx matching all strings for folder

Discussion in 'Troubleshooting and Problems' started by electrogypsy, Jan 6, 2016.

  1. electrogypsy

    electrogypsy Active Member

    Hey guys, I'm using @Liam W 's vanity urls plugin and I'm having an issue with urls. This plugin rewrites the url to a member's profile. It works fine, except for one user that has the term 'library' in his username (it's like 'library-gnome' or something like that). The url to his profile is broken. I've already run this by Liam, and he says:

    which makes total sense to me. i'm looking at my conf file though and i'm not sure how to restrict it so this doesn't happen anymore. here's the portion of my nginx config as it looks right now:

    Code:
           location / {
                    try_files $uri $uri/ /index.php?$uri&$args;
                    location /internal_data {
                            location ~ \.(data|html|php)$ {
                                    internal;
                            }
                            internal;
                    }
                    location /library {
                            location ~ \.(default|html|php|txt|xml)$ {
                                    internal;
                            }
                            internal;
                    }
              location /data/taigachat/ {
                   open_file_cache off;
                   include /usr/local/nginx/conf/staticfiles.conf;
              }
            }
    so i'm pretty sure i need to change the library portion somehow, but not sure how to do it. just wondering if anyone here has any ideas?
     
  2. Mouth

    Mouth Well-Known Member

    Yup, you don't have a location modifier so it treats your match as being a prefix. Change it to;
    Code:
    location ^~ /library/ {
     
    electrogypsy likes this.
  3. electrogypsy

    electrogypsy Active Member

    yes! that totally worked. thank you!

    do you think it would be advisable to do this for the other xf directories as well?
     

Share This Page