NGinx Not Looking at NEW Root Location
-
I've done the Guide and was able to set up a WordPress site. I've also done the LEMP Stack script LITE and set up a WP site.
I am now using the LEMP + SSH keys. Everything seems to be working fine, except I can't get NGinx to look at the root location specified in the Sites-available/webshoo.com file
* Note: Did have issues with exporting a "user' via script. It never created the user but a group. Fix, delgroup the username and manually add it via LISH (linode). All hardened security worked after.
** Note: Assume the default is correct - installed by script so no changes made.server {
listen 80;
server_name webshoo.com;
access_log /home/admin/public_html/webshoo.com/log/access.log;
error_log /home/admin/public_html/webshoo.com/log/error.log;
location / {
root /home/admin/public_html/webshoo.com/public/;
index index.php index.html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /home/admin/public_html/webshoo.com/public/$fastcgi_script_name;
}
}At my wit's end... :D
Anthony
Posted 1 year ago # -
Anyone? Hello? Bueller? Bueller? :D
Posted 12 months ago # -
Hi Anthony!
Are you getting to the 'welcome to nginx' page or whatever the default index page?
Did you add a symlink for the vhost file?
What is in your nginx conf file?
I had problems that might be similar and found adding .conf to the vhost file does some good.
Posted 12 months ago # -
Yeah thanks did all that. :)
I had to remove
server {
listen 80;
server_name http://www.DOMAIN;
rewrite ^/(.*) http://DOMAIN/$1 permanent;
}And changed the server name to my IP address:
server {
listen 80;
server_name MY IP ADDRESS, DOMAIN;
access_log /home/USER/public_html/DOMAIN/log/access.log;
error_log /home/USER/public_html/DOMAIN/log/error.log;location / {
root /home/USER/public_html/DOMAIN/public/;
index index.php index.html;
}It works now. I'm not point my "live" domain to the IP address yet, as I want to work this.
I'm going to add another vhost file for another domain to make sure it works again.
Looks like my day at the beach worked - it refreshed my brain! :)
Posted 12 months ago # -
Good to hear that @Anthony! Meanwhile i stuck with a 403 Forbidden for a wp-admin directory for one of the sites on a server. Changed permissions and all but it just won't work.
Posted 12 months ago # -
@Benja, let me get this right:-
- you get a 403 for somesite.com/wp-admin?
- but site2.com/wp-admin works fine?Permissions should be:-
1. you own files/web server is group member
2. 755 for folders, 644 for filesOn that basis, the standard virtual host configuration should work.
In what if any way have you changed it?
Posted 11 months ago #
Reply
You must log in to post.
Want HTML?
a blockquote code em strong ul ol liPlace code between backticks `codeHere`
You've got it.
