I'm running an NGINX server on my local development machine, as I want to use a development domain using a proxy pass to reach my NodeJS applications.
http://localhost:4040 -> http://www.domain.dev
http://localhost:4041 -> http://api.domain.dev
My problem is that when I try to go to www.domain.dev
the browser redirects to https://www.domain.dev
.
I added the ssl off
directive in both the server
and http
contexts and it's still forcing SSL on me. I do not want to install or deal with SSL this early in development.
I've done this with Apache forever, but I wanted to try and embrace NGINX for its load balancing capabilities.
My NGINX configuration (commented lines omitted)
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
server {
listen 80;
listen [::]:80;
server_name domain.dev www.domain.dev;
ssl off;
location / {
proxy_pass http://127.0.0.1:4040;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
}
}
server {
listen 80;
listen [::]:80;
server_name api.domain.dev;
ssl off;
location / {
proxy_pass http://127.0.0.1:4041;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
}
}
}
Thanks!