Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info
titleinfo

Use the forward proxy to route outbound traffic to desired endpoints, useful for blocking outbound traffic to undesirable sites


  1. Locate the nginx.conf file
  2. Comment out any other server blocks and the following commands

  3. Code Block
    languagetext
    titlenginx configuration
        server {
        	location / {
            	# To turn this into a forward proxy, uncomment the line below (or the one after) - SAW
            	#proxy_pass http://localhost:8085/;
            	# If you have a webserver running on IP:port via docker try the command below - SAW
            	proxy_pass http://192.168.99.100:8888/;
    		}
    		# ~ character indicates that a regular expression will follow
    		# The regex below matches on any image file with the extensions gif, jpg or png
    		location ~ \.(gif|jpg|png)$ {
    	    	root /pf/nginx/sels-sandpit/dataa/images;
    		}
        }
        
        # Selvyn's proxy server setup
    	# Essentially this sets up a nginx listener on 8085 and distributes content from "/pf/nginx/sels-sandpit/data/up1" for base url pattern match 
        server {
        	listen 8085;
    		root /pf/nginx/sels-sandpit/data/up1;
    	
    		location / {
        	}
        }


  4. Restart nginx

    1. nginx -s reload

...