Question

Add PHP to server block configuration file with Reverse Proxy

Posted April 7, 2020 116 views
Nginx

I am trying to install PHP and I in the final step of server block configuration file.

The situation is I already updated the /etc/nginx/sites-available/default with working Reverse Proxy.

How modify my file to add PHP without affect the Reverse Proxy? Note: Any Reverse Proxy is working at Port:80 and a will Install Wordpress at subdomain : blog.domain.com

Just adding at the top another Server { (info Tutorial) } block?

Tutorial Step 3:

[https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-ubuntu-18-04](http://)

Thanks for advance.

Regards

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.

×
1 answer

Hi @kaizendevar,

Yes, you are correct, you’ll just need to add the server block at the top. You can add it to different configurations as well by adding it to the specific configuration file.

If you are unsure about Nginx server blocks, I’ll recommend going through the following tutorial - https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04

It will give you the basics of server blocks as a whole

by Justin Ellingwood
When using the Nginx web server, server blocks (similar to the virtual hosts in Apache) can be used to encapsulate configuration details and host more than one domain off of a single server. In this guide, we'll discuss how to configure server blocks in Nginx on an Ubuntu...
Submit an Answer