Skip to main content

Quick Tip: Local Development with Opera, Nginx 502 error

By Bruno Skvorc

PHP

Share:

Free JavaScript Book!

Write powerful, clean and maintainable JavaScript.

RRP $11.95

This doesn’t apply to you if you’re using Apache to do local development

I was doing some local dev work recently, but for the first time in my “new” browser – Opera. I set up my Homestead Improved instance and its virtual hosts as usual, but then couldn’t get anything other than a 502 error to show up:

Screenshot 2016-06-04 17.23.37

If you inspect the dev tools, you’ll notice the status is 502 – typical of an Nginx bad gateway error.

I then spent around 30 minutes starting at dead empty error logs in my VM, and re-checking the PHP socket and ports, until it hit me that I was looking in the wrong place:

Screenshot 2016-06-04 17.23.44

Opera has VPN on by default in the version that’s current at the time of this writing, and when you try to visit a valid TLD (.com, .app, .dev, etc) with the VPN on, it crashes. The error you see is the one from Opera’s VPN which is, incidentally, running Nginx.

To solve the issue, all one has to do is turn off the VPN during local development and it’ll work.

Hope this helped someone avoid more unnecessary log hunting.

Bruno is a blockchain developer and code auditor from Croatia with Master’s Degrees in Computer Science and English Language and Literature. He's been a web developer for 10 years until JavaScript drove him away. He now runs a cryptocurrency business at Bitfalls.com via which he makes blockchain tech approachable to the masses, and runs Coinvendor, an on-boarding platform for people to easily buy cryptocurrency. He’s also a developer evangelist for Diffbot.com, a San Francisco-based AI-powered machine vision web scraper.

New books out now!

Learn valuable skills with a practical introduction to Python programming!


Give yourself more options and write higher quality CSS with CSS Optimization Basics.