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 3.2.1 Fresh Install Nginx Setup

How Do I?

jeffmace's avatar
jeffmace
113 posts
9 years ago
jeffmace's avatar jeffmace

I am getting back to EE again, but this time, the server I have to work with is using NGINX which I am not familiar with. What do I need to do to enable friendly urls and other essential setup since there is no htaccess file to use with this. Treat me as a newbie for the most part if possible and I apologize if this has been discussed. Just looking for info with the latest version here.

Also, when i did the EE_WIZARD, it tells me that I am failing for “URL Segment Support”, what can I do for this?

       
Ingo Wedler's avatar
Ingo Wedler
63 posts
9 years ago
Ingo Wedler's avatar Ingo Wedler

This is the EE part of my nginx config:

location / {
            index  index.html index.php;
            try_files $uri $uri/ @ee;
        }

        location @ee {
            rewrite ^(.*) /index.php$1 last;
        }

If it doesn’t work, give us an insight in your config please.

       
jeffmace's avatar
jeffmace
113 posts
9 years ago
jeffmace's avatar jeffmace

Thank you for replying. Not much in there. I tried putting what you have and it gave me a 500 error, not sure what it was

server {
  listen 80;
  server_name blog.com www.blog.com;
  root /home/nginx/domains/blog/public/;
  index index.php;
  access_log /home/nginx/domains/blog/log/access.log combined buffer=256k flush=60m;
  error_log /home/nginx/domains/blog/log/error.log;
  include /usr/local/nginx/conf/503include-main.conf;
  include /usr/local/nginx/conf/staticfiles.conf;
  include /usr/local/nginx/conf/php.conf;
  include /usr/local/nginx/conf/drop.conf;
  #include /usr/local/nginx/conf/errorpage.conf;
  include /usr/local/nginx/conf/vts_server.conf;

location / {
           index  index.html index.php;
           try_files $uri $uri/ @ee;
       }

       location @ee {
           rewrite ^(.*) /index.php$1 last;
       }


}
       
jeffmace's avatar
jeffmace
113 posts
9 years ago
jeffmace's avatar jeffmace

The error in the logs is

2016/04/08 14:27:47 [error] 23081#23081: *218 rewrite or internal redirection cycle while redirect to named location “@ee”

       
Ingo Wedler's avatar
Ingo Wedler
63 posts
9 years ago
Ingo Wedler's avatar Ingo Wedler

Lot of includes you have 😉

Seems there are to many internal rewrites. I would start with a simple all-in-one config, and split it up later. Cut out what you not really need. Also, the order of the rules may be important, if i remember right.

Look here https://www.nginx.com/resources/wiki/start/topics/recipes/expressionengine/ for a starting point.

And in the EE config try setting this: $config[‘uri_protocol’] = ‘AUTO’; but this may differ from OS to OS.

       

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.