nginx location with multiple subdirectories (django i18n) -


i got server, use django i18n few languages, can't make nginx serve directories using same location thing.

location /(fr|en|ko|de)/ {     proxy_pass http://127.0.0.1:8005;     proxy_set_header x-forwarded-host $server_name;     proxy_set_header x-real-ip $remote_addr;     add_header p3p 'cp=all dsp cor psaa psda our nor onl uni com nav"'; } 

but doens't work , doesn't serve request urls.

the solution seems work 1 make 4 location block, can't best solution...

so, real solution ?

you have confused syntax prefix location , regular expression location.

you need specify group of languages , therefore require regular expression.

the correct expression this:

location ~* ^/(fr|en|ko|de)/ { ... } 

see this document details.


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -