Community Forums › Forums › Archived Forums › General Discussion › Wordperss nginx Configuration Issues
- This topic has 1 reply, 1 voice, and was last updated 10 years, 4 months ago by Porter.
-
AuthorPosts
-
September 11, 2014 at 5:04 pm #124052PorterParticipant
I've been trying to get this to work for some time now, but I'm still running into issues. Here's my setup:
-LEMP (nginx instead of Apache)
-Wordpress installed in it's own directly anightinburlington.com/public_html/wordpress
-Wordpress settings for the installation to be there, and for the site url to just be anightinburlington.comAfter many changes to my configuration, I finally got the main page, and all sub-pages to show (anightinburlington.com/bars, for example), but now all of my dashboard pages are broken. I can't sign in, I just get blank white pages. In addition, my image links are broken, and I have no CSS. I'm assuming this is because I changed the nginx config without updating WordPress, but I have no idea really.
anightinburlington.com
Below is the config code in my sites-available directory.
server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /var/www/anightinburlington.com/public_html/wordpress; index index.php index.html index.htm; server_name anightinburlington.com www.anightinburlington.com; location / { # try_files $uri $uri/ =404; try_files $uri $uri/ /index.php?q=$uri&$args; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} }
Any idea how I can fix the broken site?
September 11, 2014 at 6:42 pm #124057PorterParticipantI ended up making some blind guesses, and everything is working perfect now. Here's my config:
server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /var/www/anightinburlington.com/public_html; index index.php index.html index.htm; server_name anightinburlington.com www.anightinburlington.com; location / { # try_files $uri $uri/ =404; try_files $uri $uri/ /wordpress$uri/ /index.php?q=$uri&$args; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } }
I changed the root back to /var/www/anightinburlington.com/public_html;
Then added the "wordpress" bit below:try_files $uri $uri/ /wordpress$uri/ /index.php?q=$uri&$args;
Everything appears to work 100%, but if anyone could tell me if there's something wrong, that would be great, as I'm basically shooting in the dark (with slightly educated guesses, emphasis on slightly).
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.