Our Leadership team is attending CloudFest 2026, from Mar 22 - April 8. Schedule a Connect

Our Leadership team is attending CloudFest 2026, from Mar 22 - April 8.

Discuss MSP growth, DevOps excellence, and Cloud Transformation. Available for 1:1 meetings, Schedule a Connect

  • DevOps
    Case Study

    How we helped a development company rebuild DevOps for efficiency and scale.

    READ CASESTUDY
    icon

    24/7 DevOps as a Service

    Round-the-clock DevOps for uninterrupted efficiency.

    icon

    Infrastructure as a Code

    Crafting infrastructure with ingenious code.

    icon

    CI/CD Pipeline

    Automated CI/CD pipeline for seamless deployments.

    icon

    DevSecOps

    Integrated security in continuous DevOps practices.

    icon

    Hire DevOps Engineers

    Level up your team with DevOps visionaries.

    icon

    Consulting Services

    Navigate success with expert DevOps consulting.

  • TechOps
    Case Study

    How a US hosting leader scaled with us!

    READ CASESTUDY

    WEB HOSTING SUPPORT

    icon

    HelpDesk Support

    Highly skilled 24/7 HelpDesk Support

    icon

    Product Support

    Boost your product support with our expertise.

    MANAGED SERVICES

    icon

    Server Management

    Don’t let server issues slow you down. Let us manage them for you.

    icon

    Server Monitoring

    Safeguard your server health with our comprehensive monitoring solutions.

    STAFF AUGMENTATION

    icon

    Hire an Admin

    Transform your business operations with our expert administrative support.

    icon

    Hire a Team

    Augment your workforce with highly skilled professionals from our diverse talent pool.

  • CloudOps
    Case Study

    How we helped a Private Deemed University in India, save US $3500/m on hosting charges!

    READ CASESTUDY
    icon

    AWS Well Architected Review

    Round-the-clock for uninterrupted efficiency

    icon

    Optimize

    Efficient CloudOps mastery for seamless cloud management

    icon

    Manage

    Automated CI/CD pipeline for seamless deployments

    icon

    Migrate

    Upgrade the journey, Migrate & Modernize seamlessly

    icon

    Modernize

    Simplify compliance complexities with our dedicated services

    icon

    FinOps as a Service

    FinOps as a Service

  • SecOps
    Case Study

    Enabling financial grade platforms through strategic cloud modernisation.

    READ CASESTUDY
    icon

    VAPT

    Vulnerability Assessment and Penetration Testing

    icon

    Source Code Review

    Ensuring source code security ans safe practices to reduce risks

    icon

    Security Consultation

    On demand services for improving server security

    icon

    System Hardening

    Reduced vulnerability and proactive protection

    icon

    Managed SoC

    Monitors and maintains system security. Quick response on incidents.

    icon

    Compliance as a Service

    Regulatory compliance, reduced risk

  • Insights
    Case Study

    How we helped a Private Deemed University in India, save US $3,500/m on hosting charges!

    READ CASESTUDY
    icon

    Blog

    Explore our latest articles and insights

    icon

    Case Studies

    Read about our client success stories

    icon

    Flipbook

    Explore our latest Flipbook

    icon

    Events

    Join us at upcoming events and conferences

    icon

    Webinars

    Watch our educational webinar series

  • Our Story
  • Contact Us

Interested to collaborate?

Get in touch with us!

Ready to elevate your business with certified cloud expertise? Contact us today to learn how our team can help you leverage cloud technology to drive growth, streamline operations, and enhance security.

  • AWSAWS
  • Azure CloudAzure Cloud
  • Google CloudGoogle Cloud
  • Akamai CloudAkamai Cloud
  • OVHOVH
  • Digital OceanDigital Ocean
  • HetznerHetzner
  • Managed Services Overview
  • Kubernetes Consulting
  • DevOps as a Service
  • Infrastructure Monitoring
  • Kubernetes Consultancy Services
  • K8s & Cloud native Solutions
  • 24/7 Infrastructure Monitoring
  • DevOps as a Service
  • Cloud CI/CD Solutions
  • White Labeled MSP Support
  • Our story
  • Life@SupportSages
  • Insights
  • Careers
  • Events
  • Services
  • Managed Services

aws partneraws advanced partner
LinkedInFacebookXInstagramYouTube
SupportSages

Copyright © 2008 – 2026 SupportSages Pvt Ltd. All Rights Reserved.
Privacy PolicyLegal TermsData ProtectionCookie Policy

Installation and Configuring of Varnish Reverse Proxy with Nginx

Author Profile
Sheldon Moor
  • 3 min read
Installation and Configuring of Varnish Reverse Proxy with Nginx

Generating audio, please wait...

Varnish is a proxy server which can be used for HTTP caching. It can act as a reverse proxy for nginx. Here we are going to look how we can configure varnish as a reverse proxy for nginx web server.

Prerequisites

Ubuntu 16.04

Root Privileges

Step 1: Installing nginx

We can install Nginx from the Ubuntu repository using the apt command

root@server:~# apt install nginx -y

After the installation is complete, start Nginx and enable it to launch every time at system boot using the systemctl commands below.

root@server:~#systemctl start nginx
root@server:~#systemctl enable nginx

Step 2: Configuring Nginx

We will configure nginx to run under non-standard HTTP port 8080. For this purpose, we need to edit virtual host files under ‘sites-available’ directory and change the ‘listen’ line value to 8080.

root@server:~#vi /etc/nginx/sites-available/default

------------------------------

listen 8080 default_server;

listen [::]:8080 default_server;

-------------------------------

Now test the nginx server using the command “nginx -t” and restart the service.

root@server:~# nginx -t

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok

nginx: configuration file /etc/nginx/nginx.conf test is successful

root@server:~#systemctl restart nginx

Step 3: Installing Varnish

Installing varnish from the Ubuntu repository using apt command. After installing start and enable it to launch at system boot.

apt install varnish -y

root@server:~#systemctl start varnish

root@server:~#systemctl enable varnish

Step 4 – Configuring Varnish as a Reverse Proxy for Nginx

Here we are using Varnish as a reverse proxy for the Nginx web server. So Varnish will be running on the HTTP port 80, and the Nginx web server on HTTP port 8080.

Go to the varnish configuration directory and edit the ‘default.vcl’ file.

root@server:~#vi /etc/varnish/default.vcl

On the backend line, define the configuration as below.

backend default {

.host = "127.0.0.1";

.port = "8080";

}

After that edit the Varnish configuration file and on the ‘DAEMON_OPTS’ line, change the default port 6081 to HTTP port 80.

root@server:~#vi /etc/default/varnish

-----------------------------------------

DAEMON_OPTS="-a :80 \

-T localhost:6082 \

-f /etc/varnish/default.vcl \

-S /etc/varnish/secret \

-s malloc,256m"

-------------------------------------------

Now go to the systemd system directory and edit the varnish.service file.

vi /lib/systemd/system/varnish.service

Step 5: Reload the systemd configuration and restart varnish.

root@server:~#systemctl daemon-reload

root@server:~#systemctl restart varnish

Step 6 : Configuring UFW Firewall

In this step, we will activate the firewall and open new ports for SSH, HTTP, and HTTPS.

root@server:# ufw allow ssh

root@server:# ufw allow http

root@server:# ufw allow https

Step 7: Testing

Test varnish using the curl command, so we can see HTTP headers from the server.

root@server:~# curl -I http://136.243.201.230
HTTP/1.1 200 OK
Server: nginx/1.10.3 (Ubuntu)
Date: Thu, 21 Mar 2019 09:58:33 GMT
Content-Type: text/html
Last-Modified: Mon, 04 Mar 2019 10:36:49 GMT
ETag: W/"5c7cffc1-2a"
Vary: Accept-Encoding
X-Varnish: 5 3
Age: 7
Via: 1.1 varnish-v4
Accept-Ranges: bytes
Connection: keep-alive

Thank You for reading!!

Server Management

  • Sever management

Installing Varnish Cache to boost Apache’s Performance

Installing Varnish Cache to boost Apache’s Performance
  • Apache
logo

WordPress tweaks via wp-config.php file

WordPress tweaks via wp-config.php file
  • WordPress
logo
Installation and Configuring of Varnish Reverse Proxy with Nginx

Posts by Sheldon Moor

Sheldon Moor