Welcome! Log In Create A New Profile

Advanced

Proxy http site without access log?

Posted by pdh0710 
Proxy http site without access log?
August 07, 2018 08:37AM
(Please excuse my English. The domain names used in this post are examples, not real ones)

I opened websites " https://my.server.com " and homepage " https://my.server.com/index.html "
with a nginx server.The problem is the homepage index.html contains a iframe, who's source
url is " http://www.example.com ".
As many one knows, nowaday web browsers strictly prohibit https site to access to http site.
So, the index.html cannot display the iframe properly.

To solve this problem, I added another https server block(port 2424) in my nginx.conf, to proxy
the http://www.example.com site.

server {
server_name my.server.com;
listen 2424 ssl;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;

ssl_protocols TLSv1.2 TLSv1.1 TLSv1;

ssl_session_cache shared:le_nginx_SSL:10m;
ssl_session_timeout 60m;

location / {
sendfile off;
tcp_nopush off;
tcp_nodelay on;

#location ~ \.(ico|png|gif)$ { # commented out
# access_log off;
#}

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_read_timeout 90;

proxy_pass http://www.example.com;
}
}

The above code is the added proxy server block. My nginx server operated well with the above proxy server block.
But the problem occured when I uncommented the below location block. The location block is often used
so that *.ico, *.png and *.gif files do not leave access log.

location ~ \.(ico|png|gif)$ {
access_log off;
}

When I uncommented the location block, my proxy server could not transfer *.ico, *.png and *.gif files from
http://www.example.com.

How can I transfer the *.ico, *.png and *.gif files from http://www.example.com without access log?

Additionally, I am not good at proxy server setting. If there are no good settings in my proxy server block,
Please leave comments.



Edited 1 time(s). Last edit at 08/07/2018 08:39AM by pdh0710.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 81
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready