We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

EE and Nginx, not working for me

How Do I?

ckubs's avatar
ckubs
5 posts
4 years ago
ckubs's avatar ckubs

Coming from WP I thought EE is better suited for a new website. Installed EE6 Beta3 and everything worked as it should except that, I got the 404 error on every page except the root page and the admin area. I’m on Nginx.

Tried to solve the problem with my limited knowledge before posting on the forum but I couldn’t. It even dawned on me to reinstall from scratch, replacing Nginx with Apache but I have a lot of other things depending on Nginx.

Thank you for any help.

       
Brian Litzinger's avatar
Brian Litzinger
693 posts
4 years ago
Brian Litzinger's avatar Brian Litzinger

I’m not an nginx expert by any means, but EE runs fine on nginx. You just need to configure it correctly. I use ddev for my local environments and it just works out of the box. https://www.ddev.com/

       
ckubs's avatar
ckubs
5 posts
4 years ago
ckubs's avatar ckubs

I think I’m not configuring it correctly? Found an article about that, but it was targeting EE 3.

The part related to location on my Nginx config is this

    location / {
    try_files $uri $uri/ /index.php?$args; location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
        expires     max;
        fastcgi_hide_header "Set-Cookie";
    }

    # deny running scripts inside writable directories
    location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
        return 403;
        error_page 403 /403_error.html;
    }

    location ~ [^/]\.php(/|$) {
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        if (!-f $document_root$fastcgi_script_name) {
            return  404;
        }

        fastcgi_pass    unix:/run/php/php7.3-fpm-mysite.com.sock;
        fastcgi_index   index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include         /etc/nginx/fastcgi_params;
    }
}
       
ckubs's avatar
ckubs
5 posts
4 years ago
ckubs's avatar ckubs

Managed to fix it.

An option to mark topics as solved in the forum component would be awesome. Also a way to reply/quote. Not only on forum but blog comments too.

πŸ‘ 1
       
Robin Sowell's avatar
Robin Sowell
13,158 posts
4 years ago
Robin Sowell's avatar Robin Sowell

Glad you got it running and the forum is definitely a work in progress. It’s just a bit far down the list at the moment. But we’ll get there!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.