Question

Cant deploy my static web App which includes some PHP scripts

Hi All,

Can anyone help me how to configure Nginx conf file? I am trying to deploy my static web app which consists of a small PHP script. I followed tutorials given on digital community portal but not able to figure it out. I added index.php but as of I am not able to execute the file and every time asks me to download.

Show comments

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

KFSys
Site Moderator
Site Moderator badge
June 5, 2020
Accepted Answer

Hi @viraljayeshjoshi94,

It seems you’ve deployed all your Nginx server blocks in the /etc/nginx/sites-enabled/default file. For this to work, you’ll need to create a separate .conf file for your domain.

If you are uncertain how to do this, DigitalOcean has a pretty good tutorial on how to actually achieve exactly what you need.

https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04

In the tutorial for demonstration purposes,two domains are going to be set up with Nginx. The domain names used in this guide are example.com and test.com. I believe it will be really beneficial and will help you create the new conf for yourself as well.

Regards, KDSys

This comment has been deleted

    Try DigitalOcean for free

    Click below to sign up and get $200 of credit to try our products over 60 days!

    Sign up

    Get our biweekly newsletter

    Sign up for Infrastructure as a Newsletter.

    Hollie's Hub for Good

    Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

    Become a contributor

    Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

    Welcome to the developer cloud

    DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

    Learn more
    DigitalOcean Cloud Control Panel