Welcome Guest, Not a member yet? Register   Sign In
Getting Internal Server Error when i use nginx config
#1

I tried to use nginx config from https://codeigniter4.github.io/userguide...ight=nginx

i am getting internal server error on args.

For example www.example.com/home/test

I changed that example with 

PHP Code:
location / {
try_files $uri $uri/ /index.php$args


dropped just one / and now it's working...
pro novice
Reply
#2

Hi,

Thanks for the information. It's indeed incorrect in the documentation.

If I'm not mistaken you can leave $args out completely from CI4.
PHP Code:
location / {
        try_files $uri $uri/ /index.php;


If you still want $args to be passed to CI, you should make sure a ? are passed to the index.php file. With $is_args it checks if a ? are needed (if $args are not empty). So it don't append ? all the time.
PHP Code:
location / {
        try_files $uri $uri/ /index.php$is_args$args;

Reply




Theme © iAndrew 2016 - Forum software by © MyBB