Return to site

Multiple Proxy Manager

broken image


2013-02-15

Like many employees who are given company laptops, I use mine at both work and at home. And like many companies, mine forces all web traffic through a proxy server (which is unfortunately located in another country, causing HUGE bottlenecks). And as Chrome is my browser of choice, I need a way to reconcile my Chrome proxy profiles so that I can quickly switch between using and not using a proxy.

My problem with Chrome's proxy settings

  • # an http proxy server to use (enter server FQDN) proxyhostname = myproxy.example.com # port for http proxy server proxyport = 8080 # user name for authenticating to an http proxy, if needed proxyuser = proxyusername # password for basic http proxy auth, if needed proxypassword = proxypassword.
  • Click Start then search for Luminati Proxy Manager. Wait until it boot. If a new browser window is not popping up, open a browser and navigate to 127.0.0.1:22999. Watch our tutorial video. Are you experiencing any problem with the Proxy Manager?

To change proxy settings in Chrome, you can follow this tutorial. But, to summarize: 'Customize and Control Google Chrome' >> 'Settings' >> 'Change Proxy Settings' >> 'LAN Settings' >> And then set proxy settings as desired.

Toolbar icon indicates the current type of proxy your browser currently using (No Proxy Mode, Auto-detect Proxy Mode, Manual Mode, and PAC Script Mode). The extension is designed such that no resource is used while the panel is closed. Note: Toolbar icon is an indicator of the current proxy type. Hover mouse over the toolbar button to get more. Proxypass sends the data to http:/ I spend quite some time to figure out how nginx needs to be configured to run a https vhost on port 443 and do a proper reverse.

As it turns out, Chrome uses IE's proxy settings, so you could also go through IE to set your proxy. Or, probably through some administrative tab in Windows… But, the overriding issue is that if you have your proxy settings set up as they are at work, and then go home and try to use the internet (without being on your company's VPN), then you're stuck and cannot use the internet… Unfortunate…

For me, this meant that when I came home from work (or switched to the non-corporate-secured wi-fi in the office), I would have to remember to also change proxy settings. After a week, this became very tedious as I needed to do it 4-5 times per day, and 1-2 times I would forget, try to use the internet, and think the internet was broken for 10-20 seconds.

As far as getting around this, I only recently found Switchy [Update Nov 2014: Link no longer works], which is a proxy manager for Chrome. But, as I've mentioned in another post, I'm not keen on installing 3rd party software or Chrome extensions without a very good reason (especially on my work computer).

Manager

My Chrome proxy solution

Note: Since Chrome uses IE's proxy settings by default, a new instance of Chrome will default to the current IE settings. However, if Chrome is already running, then every new Chrome process will inherit the current Chrome proxy settings.

What I ended up going with was having two Chrome shortcuts. One that uses the default IE proxy settings (which I leave on 90% of the time now), and another shortcut that starts Chrome without a proxy server.

The most important part about this whole operation is the –proxy-server= setting, as leaving that unfilled will cause Chrome to ignore IE's proxy settings.

There is one hitch in this solution that I have not overcome. As I mentioned earlier, each instance of Chrome will adhere to the proxy settings of currently open Chrome processes. Meaning, for this shortcut to have any effect, you have to close all existing Chrome browsers, and then re-open them via the shortcut.

It's not a big problem, but it does suck if you have a bunch of tabs that you want to keep working on. So, in these cases, I close all Chrome instances, open the proxy/non-proxied Chrome, and then click 'Recently closed tabs' at the bottom of the Chrome start-up page… Well, actually I use shortcuts, so I press 'Ctrl + Shift + t'.

I hope that helps anyone who has run into Chrome proxy issues before. If anyone has advice on how I could streamline this even further - like, being able to have independently proxies browsers (aka. 'The Dream') - please let me know!

Nginx HTTPS Reverse Proxy Overview

A Nginx HTTPS reverse proxy is an intermediary proxy service which takes a client request, passes it on to one or more servers, and subsequently delivers the server's response back to the client. While most common applications are able to run as web server on their own, the Nginx web server is able to provide a number of advanced features such as load balancing, TLS/SSL capabilities and acceleration that most specialized applications lack. By using a Nginx reverse proxy all applications can benefit from these features.

Benefits of Using a Nginx Reverse Proxy on an Instance

There are a important benefits of setting up a Nginx HTTPS reverse proxy:

(episode 23)Weeknights 2:15 a.m. (episodes 20–22)Friday 1:45 a.m. (episode 13–19)Saturday 7:00 p.m. (episode 24-26)52October 5, 20150.28TBATBAfor CNWeekdays 5:00 p.m.

Multiple Proxy Manager Software

  • Load Balancing: A Nginx reverse proxy can perform load balancing which helps distribute client requests evenly across backend servers. It also improves redundancy as if one server goes down, the reverse proxy will simply reroute requests to a different server according to the routing policy.
  • Increased Security: A Nginx reverse proxy also acts as a line of defense for your backend servers. Configuring a reverse proxy ensures that the identity of your backend servers remains unknown.
  • Better Performance: Nginx has been known to perform better in delivering static content file and analyse URLs
  • Easy Logging and Auditing: Since there is only one single point of access when a Nginx reverse proxy is implemented, this makes logging and auditing much simpler.
  • Encrypted Connection By encrypting the connection between the client and the Nginx reverse Proxy with TLS, users profit from a encrypted and securized HTTPS connection, protecting their data.

Requirements:

  • You have an account and are logged into console.scaleway.com
  • You have configured your SSH Key
  • You have sudo privileges or access to the root user.
  • You have an web application running on a non-standard web port on the instance
  • You have a compute instance running Ubuntu Bionic Beaver
  • Make sure your domain name points towards your server ip (A or AAAA record)

Multiple Proxy Manager Job

Installing and Configuring Nginx

Note: This tutorial requires that you have already a web application running on your instance. You can for example install a lightweight web server like Webfsd, which runs on port 8000 by default to be joignable on the standard HTTP(s) ports via the proxy. If required it can be installed with apt install webfs

In the following example, we will configure an Nginx reverse proxy in front of an Apache web server. As a result, we assume that Apache is already installed and configured (on the same machine).

1 . Update the APT packet cache and install the Nginx web server via the packet manger:

2 . Disable the default virtual host, that is pre-configured when Nginx is istalled via Ubuntu's packet manager apt:

3 . Enter the directory /etc/nginx/sites-available and create a reverse proxy configuration file.

4 . Paste the following Nginx configuration in the text editor. The proxy server redirects all incomming connections on port 80 to the Webfsd server, listening on port 8000. Edit the port value depending on the applications specific port.

Note: Accesses and errors are located in a log files at /var/log/nginx.

5 . Copy the configuration from /etc/nginx/sites-available to /etc/nginx/sites-enabled. It is recommended to use a symbolic link.

Multiple Proxy Manager Interview

6 . Test the Nginx configuration file

which returns

7 . Open a web browser on your local computer and paste your public_ip which will display your web applications homepage.

Adding TLS to your Nginx Reverse Proxy using Let's Encrypt

Important: Make sure your domain name points towards your server ip (A or AAAA record).

With the current setup, all incoming traffic on the standard, non-securized, HTTP port is anserwered by Nginx, which passes it to the web application on the instance.

For security reasons, it is recommended to add an encryption layer with TLS/SSL and to use HTTPS. Whilst it is technically possible to use self-signed certficates, it may cause very inconveniences as a warning is displayed by default in an users web browser when a self-signed certificate is used. A certificate authentity (CA) can issue trusted certificates which a recognized by most modern web browsers. The CA Let's Encrypt provides TLS certificate for free and the configuration of Nginx can be done easily with Certbot, a tool provided by the EFF.

1 . Install Certbot on your instance by using the APT packet manager:

Multiple Proxy Manager Training

2 . Certbot provides a plugin designed for the Nginx web server, automatizing most of the configuration work related with requesting, installing and managing the TLS certificate:

3 . Answer the prompts that display on the screen to request a valid Let's Encrypt TLS certificate:

Multiple Proxy Manager
Multiple Proxy Manager

My Chrome proxy solution

Note: Since Chrome uses IE's proxy settings by default, a new instance of Chrome will default to the current IE settings. However, if Chrome is already running, then every new Chrome process will inherit the current Chrome proxy settings.

What I ended up going with was having two Chrome shortcuts. One that uses the default IE proxy settings (which I leave on 90% of the time now), and another shortcut that starts Chrome without a proxy server.

The most important part about this whole operation is the –proxy-server= setting, as leaving that unfilled will cause Chrome to ignore IE's proxy settings.

There is one hitch in this solution that I have not overcome. As I mentioned earlier, each instance of Chrome will adhere to the proxy settings of currently open Chrome processes. Meaning, for this shortcut to have any effect, you have to close all existing Chrome browsers, and then re-open them via the shortcut.

It's not a big problem, but it does suck if you have a bunch of tabs that you want to keep working on. So, in these cases, I close all Chrome instances, open the proxy/non-proxied Chrome, and then click 'Recently closed tabs' at the bottom of the Chrome start-up page… Well, actually I use shortcuts, so I press 'Ctrl + Shift + t'.

I hope that helps anyone who has run into Chrome proxy issues before. If anyone has advice on how I could streamline this even further - like, being able to have independently proxies browsers (aka. 'The Dream') - please let me know!

Nginx HTTPS Reverse Proxy Overview

A Nginx HTTPS reverse proxy is an intermediary proxy service which takes a client request, passes it on to one or more servers, and subsequently delivers the server's response back to the client. While most common applications are able to run as web server on their own, the Nginx web server is able to provide a number of advanced features such as load balancing, TLS/SSL capabilities and acceleration that most specialized applications lack. By using a Nginx reverse proxy all applications can benefit from these features.

Benefits of Using a Nginx Reverse Proxy on an Instance

There are a important benefits of setting up a Nginx HTTPS reverse proxy:

(episode 23)Weeknights 2:15 a.m. (episodes 20–22)Friday 1:45 a.m. (episode 13–19)Saturday 7:00 p.m. (episode 24-26)52October 5, 20150.28TBATBAfor CNWeekdays 5:00 p.m.

Multiple Proxy Manager Software

  • Load Balancing: A Nginx reverse proxy can perform load balancing which helps distribute client requests evenly across backend servers. It also improves redundancy as if one server goes down, the reverse proxy will simply reroute requests to a different server according to the routing policy.
  • Increased Security: A Nginx reverse proxy also acts as a line of defense for your backend servers. Configuring a reverse proxy ensures that the identity of your backend servers remains unknown.
  • Better Performance: Nginx has been known to perform better in delivering static content file and analyse URLs
  • Easy Logging and Auditing: Since there is only one single point of access when a Nginx reverse proxy is implemented, this makes logging and auditing much simpler.
  • Encrypted Connection By encrypting the connection between the client and the Nginx reverse Proxy with TLS, users profit from a encrypted and securized HTTPS connection, protecting their data.

Requirements:

  • You have an account and are logged into console.scaleway.com
  • You have configured your SSH Key
  • You have sudo privileges or access to the root user.
  • You have an web application running on a non-standard web port on the instance
  • You have a compute instance running Ubuntu Bionic Beaver
  • Make sure your domain name points towards your server ip (A or AAAA record)

Multiple Proxy Manager Job

Installing and Configuring Nginx

Note: This tutorial requires that you have already a web application running on your instance. You can for example install a lightweight web server like Webfsd, which runs on port 8000 by default to be joignable on the standard HTTP(s) ports via the proxy. If required it can be installed with apt install webfs

In the following example, we will configure an Nginx reverse proxy in front of an Apache web server. As a result, we assume that Apache is already installed and configured (on the same machine).

1 . Update the APT packet cache and install the Nginx web server via the packet manger:

2 . Disable the default virtual host, that is pre-configured when Nginx is istalled via Ubuntu's packet manager apt:

3 . Enter the directory /etc/nginx/sites-available and create a reverse proxy configuration file.

4 . Paste the following Nginx configuration in the text editor. The proxy server redirects all incomming connections on port 80 to the Webfsd server, listening on port 8000. Edit the port value depending on the applications specific port.

Note: Accesses and errors are located in a log files at /var/log/nginx.

5 . Copy the configuration from /etc/nginx/sites-available to /etc/nginx/sites-enabled. It is recommended to use a symbolic link.

Multiple Proxy Manager Interview

6 . Test the Nginx configuration file

which returns

7 . Open a web browser on your local computer and paste your public_ip which will display your web applications homepage.

Adding TLS to your Nginx Reverse Proxy using Let's Encrypt

Important: Make sure your domain name points towards your server ip (A or AAAA record).

With the current setup, all incoming traffic on the standard, non-securized, HTTP port is anserwered by Nginx, which passes it to the web application on the instance.

For security reasons, it is recommended to add an encryption layer with TLS/SSL and to use HTTPS. Whilst it is technically possible to use self-signed certficates, it may cause very inconveniences as a warning is displayed by default in an users web browser when a self-signed certificate is used. A certificate authentity (CA) can issue trusted certificates which a recognized by most modern web browsers. The CA Let's Encrypt provides TLS certificate for free and the configuration of Nginx can be done easily with Certbot, a tool provided by the EFF.

1 . Install Certbot on your instance by using the APT packet manager:

Multiple Proxy Manager Training

2 . Certbot provides a plugin designed for the Nginx web server, automatizing most of the configuration work related with requesting, installing and managing the TLS certificate:

3 . Answer the prompts that display on the screen to request a valid Let's Encrypt TLS certificate:

Multiple Proxy Manager Chrome Extension

When asked if you want to redirect HTTP traffic automatically to HTTPS, choose the option 2. This enables the automatic redirection of all incoming requests via an unencrypted HTTP connection to a secure HTTPS connection. Providing an additional layer of security for the Web application running behind the Nginx reverse proxy.





broken image