• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Configure Nginx as a Reverse Proxy for Apache (HP Cloud)

By Abhishek Ghosh June 18, 2015 7:36 pm Updated on June 18, 2015

Configure Nginx as a Reverse Proxy for Apache (HP Cloud)

Advertisement

Here is How To Configure Nginx as a Reverse Proxy for Apache on HP Cloud Instance Running Ubuntu or Any Deb GNU/Linux. Both listen to port 80. We talked about Reverse Proxy and Reverse Proxying with Nginx Before. This is not a fully new users’ guide.

 

Configure Nginx as a Reverse Proxy for Apache : Specific For HP Cloud

 

Router, Subnet settings should be set properly to allow Port 80 Ingress and Egress.

If we run Apache behind Nginx, then the Port will be 8080. This is for who do not want to use PHP via FastCGI i.e. run a separate PHP5-FPM process.

Advertisement

---

If we configure for Side by Side running, we will use Port 80. Side by Side running needed when the web software does not support Nginx. If need to update the NameVirtualHost directive with IP in this case.

 

Configure Nginx as a Reverse Proxy for Apache

 

First we need to install Nginx :

Vim
1
2
apt-get install nginx
# apt-get install nginx-full

First we need edit the /etc/nginx/sites-available/default file :

/etc/nginx/sites-available/default
Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
server {
     listen   80;
# /usr/share/nginx/html;
      root /var/www/;
      server_name thecustomizewindows.com;
        index index.php index.html index.htm;
        server_name thecustomizewindows.com;
      access_log logs/nginx_access.log;
      error_log logs/nginx_error.log;
      location / {
            try_files $uri $uri/ @backend;
      }
      location @backend {
            proxy_set_header X-Real-IP  $remote_addr;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_set_header Host $host;
            proxy_pass http://127.0.0.1:8080;
#         proxy_pass http://10.0.0.1:8080;
      }
      
      location ~ /\.ht {
                deny all;
        }
}

If Nginx fails then it will pass the request to Apache2. Be careful about the listen 80; directive. Test with commenting it out and running nginx -t.

Configure Nginx as a Reverse Proxy for Apache (HP Cloud)

Now we will install Apache2 :

Vim
1
apt-get install apache2

We have edit two files, one is /etc/apache2/ports.conf :

/etc/apache2/ports.conf
Vim
1
2
NameVirtualHost 127.0.0.1:8080
Listen 127.0.0.1:8080

Second, we have copy the default file, edit the port to 8080 :

Vim
1
2
cp /etc/apache2/sites-available/default /etc/apache2/sites-available/thecustomizewindows
nano /etc/apache2/sites-available/thecustomizewindows

That file should have :

Vim
1
<VirtualHost 127.0.0.1:8080>

Apache2 virtual host should be corrected to have the same web root :

Vim
1
2
3
4
5
<VirtualHost>
      DocumentRoot "/var/www/"
      ServerName thecustomizewindows.com
      ...
</VirtualHost>

Now activate it :

Vim
1
sudo a2ensite thecustomizewindows

thecustomizewindows is just a name used. Then we can install PHP5 and restart the services :

Vim
1
2
3
apt-get install php5
service apache2 restart
service nginx restart

Tagged With how to config nginx as reverse proxy ubuntu , nginx reverse proxy apache centos

This Article Has Been Shared 318 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Configure Nginx as a Reverse Proxy for Apache (HP Cloud)

  • Cloud Computing 3D Rendering And Scope In Film Industry

    Cloud Computing 3D Rendering Has Definite Scope in Film Industry which might alarm the Stars of tomorrow and relieve the Producers investing in the Films.

  • Cloud Computing and Designing Own Truly Scalable System

    Cloud Computing becomes fully enjoyable if it is arranged to make a scalable system for the application or CMS or any web software including WordPress.

  • How Cloud Computing Challenge The Networks

    How Cloud Computing Challenge Networks with virtually unlimited storage and computing capacity, reduced cost and maximum flexibility and massive data traffic.

  • PubSubHubbub and Rackspace Cloud Queue

    PubSubHubbub is a networking protocol. Rackspace is Open Source but infamous for difficult to understand API documentation by normal human.

  • How to Upload Backup to Dropbox from Cloud Server

    Here is How to Upload Backup to Dropbox from Cloud Server in Case You Want To Keep Your Backup of Files and Database on a Free Cloud Storage.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (22.1K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Big Data in Sports May 20, 2022
  • FaaS Versus PaaS Deployment: What You Should Know May 18, 2022
  • What Is A Digital Media Consultancy? May 17, 2022
  • How Artificial Intelligence (AI) Is Changing The Way We Play Bingo May 16, 2022
  • Why You Need A Big Data Consultant May 15, 2022

About This Article

Cite this article as: Abhishek Ghosh, "Configure Nginx as a Reverse Proxy for Apache (HP Cloud)," in The Customize Windows, June 18, 2015, May 20, 2022, https://thecustomizewindows.com/2015/06/configure-nginx-as-a-reverse-proxy-for-apache-hp-cloud/.

Source:The Customize Windows, JiMA.in

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Privacy Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2022 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy