# Http 500 error... nginx questions

**URL:** https://discourse.roots.io/t/http-500-error-nginx-questions/11056
**Category:** general
**Created:** 2017-12-02T23:43:41Z
**Posts:** 7

## Post 1 by @brightsite — 2017-12-02T23:43:41Z

Hi guys,

Went to login to a local dev site and after running up Vagrant I found that the site has a HTTP 500 error. Am working on updating plugins (first in staging and then on production - in Digital Ocean).

Guess I need to find the error log for Nginx. But can’t quite work out where it is or even where nginx is installed.

Am running Max OS 10.13.1 with Sage 8 I think.

Can anyone point me in the right direction? The docs for Nginx and various articles I’m finding on the web aren’t matching my config.

---

## Post 2 by @swalkinshaw — 2017-12-02T23:50:17Z

Is this a Trellis based project?

If so you can find them in `/srv/www/<site>/logs`.

If not, it completely depends on your setup.

---

## Post 3 by @brightsite — 2017-12-03T14:23:47Z

Thanks Scott, that helped me find the error logs.

Looks some sort of redirection loop… any idea why this may occur? Or how to rectify?

2017/12/01 21:10:31 [crit] 1397#1397: \*99 stat() “/srv/www/majacmedical/current/web/index.php” failed (5: Input/output error), client: 192.168.50.1, server: majacmedical.dev, request: “GET /favicon.ico HTTP/1.1”, host: “majacmedical.dev”, referrer: "[http://majacmedical.dev/](http://majacmedical.dev/)"  
2017/12/01 21:10:31 [error] 1397#1397: \*99 rewrite or internal redirection cycle while internally redirecting to “/index.php”, client: 192.168.50.1, server: majacmedical.dev, request: “GET /favicon.ico HTTP/1.1”, host: “majacmedical.dev”, referrer: "[http://majacmedical.dev/](http://majacmedical.dev/)"  
2017/12/03 13:09:11 [crit] 1397#1397: \*101 stat() “/srv/www/majacmedical/current/web/” failed (5: Input/output error), client: 192.168.50.1, server: majacmedical.dev, request: “GET / HTTP/1.1”, host: “majacmedical.dev”

2017/12/03 13:37:35 [crit] 1397#1397: \*102 stat() “/srv/www/majacmedical/current/web/index.php” failed (5: Input/output error), client: 192.1682017/12/03 13:37:35 [crit] 1397#1397: \*102 stat() “/srv/www/majacmedical/current/web/index.php” failed (5: Input/output error), client: 192.168.50.1, server: majacmedical.dev, request: “GET / HTTP/1.1”, host: "majacmedical.dev

2017/12/03 13:37:35 [crit] 1397#1397: \*103 stat() “/srv/www/majacmedical/current/web/index.php” failed (5: Input/output error), client: 192.168.50.1, server: majacmedical.dev, request: “GET /favicon.ico HTTP/1.1”, host: "majacmedical.dev"  
2017/12/03 13:37:35 [error] 1397#1397: \*103 rewrite or internal redirection cycle while internally redirecting to “/index.php”, client: 192.168.50.1, server: majacmedical.d

---

## Post 4 by @brightsite — 2017-12-03T14:58:01Z

Would running “npm install” in another project folder potentially cause this?

---

## Post 5 by @fullyint — 2017-12-04T00:12:22Z

> [@brightsite](#):
>
> Would running “npm install” in another project folder potentially cause this?

I doubt it.

### browser cache

I wonder if a browser caching issue could be involved. You might try clearing your browser’s cache for this site, generally viewing it in incognito mode or private browsing tab, and maybe [clear hsts](https://www.google.com/search?q=clear+hsts) headers.

### .dev :arrow_right: .test

You might consider adjusting your dev site(s) to use .test instead of .dev. See details…

> <https://github.com/roots/trellis/pull/923>
>
> see #580 and https://ma.ttias.be/chrome-force-dev-domains-https-via-preloaded-hs…ts/
> 
> also: **https://roots.io/guides/updating-development-tld-from-dev-to-test/**

So, you’d edit `site_hosts` in `group_vars/development/wordpress_sites.yml`.

If you do this, consider whether you need to search/replace `example.dev` to `example.test` in your dev database. You could use [wp-cli](https://developer.wordpress.org/cli/commands/search-replace/) or a plugin like WP Migrate DB Pro.

Also, I’d recommend not defining [`wp_home` and `wp_siteurl` in the `env`](https://roots.io/trellis/docs/wordpress-sites/#common) of `wordpress_sites.yml` so that Trellis will use its dynamic default values instead. Maybe you weren’t defining those values anyway.

### MacOS High Sierra

Whether it’s relevant to this issue or not, you may want to check whether you are affected by this issue with the High Sierra filesystem.

[https://discourse.roots.io/t/high-sierra-upgrade-issues-with-filesystem/10594/8](https://discourse.roots.io/t/high-sierra-upgrade-issues-with-filesystem/10594/8)

### /etc/hosts

You could double-check your local machine’s `/etc/hosts` files for any potential conflicting entries related to your dev VM’s IP (probably `192.168.50.5`).

### Reload or Destroy and Rebuild

If this is an older existing VM that you’ve started back up, maybe the issue would resolve itself if you were to export the DB (if you need it) and `vagrant reload` or `vagrant destroy -f && vagrant up`.

---

## Post 6 by @brightsite — 2017-12-04T02:04:51Z

Thanks Phil and Ben for your detailed responses.

I think this could be related to the High Sierra upgrade.

When ssh’d into the Vagrant box if I try to get into the Trellis folder I get this:

vagrant@majacmedical:~$ ls  
ls: cannot access ‘trellis’: Input/output error

Will do some more work on this tomorrow, but maybe you’re right I need to export the DB and re-create the local machine.

---

## Post 7 by @brightsite — 2017-12-04T18:24:25Z

Yay! That High Sierra fix worked for me.

Thanks so much Ben! :slight_smile:
