Question
How to setup Ngnix as reverse proxy for Drupal served using Apache?
I am running a Drupal 7 website using Apache. But, now my requirement has changed. I need to run some other Django apps using Nginx. So, I want to use nginx as reverse proxy for apache. I will server Apache under 8080. Now, my site already has a SSL certificate using letsencrypt with apache plugin. So, will this configuration be enough ?
server {
listen 80;
root /var/www/html/;
index index.php index.html index.htm;
server_name bringdomain.com www.bringdomain.com;
location / {
root /var/www/html;
index index.html index.htm;
proxy_pass http://127.0.0.1:8080;
proxy_redirect off;
proxy_read_timeout 1200;
proxy_send_timeout 1200;
proxy_connect_timeout 75;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
}
location ~* ^.+\.(jpg|gif|jpeg|ico|avi|mpeg|mpg|wmv|png|css|js|xml)$ {
root /var/www/html;
}
}
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×