1

Ok, so I am working for this new company and was not able to obtain any knowledge from their old developer about the nginx configuration. Everything has been fine until I starting running into this very frustrating issue. There is a directory like this: site.com/(contains a dev folder and a public folder)/(exact copies of the sites) I have tried over and over to get access to the dev section from the web. I tried a dev. configuration like this

    server {
    listen   80;
    listen [::]:80;

    server_name  dev.site.net;
    # note that these lines are originally from the "location /" block
    root   directory/site.net/dev;
    index index.php index.html index.htm;

    ssl off;
} 

and like this: trying to use another empty domain to reference the path.

server {
    listen   80;
    listen [::]:80;

    server_name  testDomain.com www.testDomain.com;
    # note that these lines are originally from the "location /" block
    root   /directory/site.net/dev;
    index index.php index.html index.htm;

    ssl off;

if($redirect_https = 1){
    return 301 http://www.getmoreforit.com$request_uri; 
}

I am certain that the domain is being pointed to the correct place in the DNS. However, both of the methods yield one of two results. It either brings me to a screen with a username and password prompt in the browser, for which I have tried all the passwords and usernames I was left with. None of which work. That, or it redirects me to a completely different site on the server, despite fairly clear configuration in this configuration files. I am confused. Help pls

  • Oh, right now I'm getting a 403 Forbidden – GMan May 17 at 17:02
  • Maybe ... that directory is password protected? Look for .htaccess files in that /dir, some admins like to use apache_tools to be able to use .htaccess files in nginx. – bjoster May 17 at 18:29
  • I fixed the 403 by using chmod -R 655 dev, now I am getting an internal 500. If I enable debugging in wordpress it's not getting any output on the browser so now I need to figure out how to fix the 500 and I should be good. Any suggestions? – GMan May 17 at 18:45
  • Please show the complete nginx configuration in the question. – Tero Kilkanen May 19 at 7:46
  • Error 500 may be a completely different root cause. You should be able to find hints in your error_log and/or php_error_log. – bjoster May 20 at 8:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.