I have been trying to configure nginx to act as a web proxy (like squid) to be able to modify headers. It is working with http, but https shows "Server not found". Also, I can access directly with the url and it downloads https resources, if I reload it fails to load https resources...... what am I doing wrong?
this is my nginx.conf:
worker_processes 1;
events {
worker_connections 1024;
}
http {
types_hash_max_size 4096;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
upstream @squid {
server 127.0.0.1:3128;
}
server {
listen 3120 ;
ssl_certificate /etc/nginx/certs/cert.crt;
ssl_certificate_key /etc/nginx/certs/cert.key;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_prefer_server_ciphers on;
location / {
resolver 8.8.8.8 192.168.1.254;
#proxy_bind 127.0.0.1:3128;
proxy_http_version 1.1;
proxy_pass $scheme://$host$request_uri;
#proxy_set_header Host $host;
#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header X-Forwarded-Proto $scheme;
#proxy_set_header Request-URI $request_uri;
proxy_redirect off;
#proxy_pass http://$host$request_uri;
}
}
}