Nginx downloading file instead of displaying php






















I have this issue too… Same config… My droplet is www. Referenced it from a working server, then ran a quick search for additional info. Kamal, thank you for your answer. I keep downloading the index. Make sure you already installed it by typing php -v. If there is no version information about your PHP, then you should install it with:.

Where would you like to share this to? Twitter Reddit Hacker News Facebook. Share link Question share link. Sign Up. Yes, I'm sure. You previously marked this answer as accepted. Are you sure you want to unaccept it? DigitalOcean home. Community Control Panel. Best practices recommend dedicated server blocks. Even dynamically configured load balancers with service discovery generate full server blocks, based on an nginx template. See: nginx-proxy used with a template generator docker-gen using an nginx template nginx.

If you scan the template you see dedicated server blocks and some 'global' settings — L. Basically anything that is allowed in the http context.

See map in the nginx docs as an example. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Who is building clouds for the independent developer? Exploding turkeys and how not to thaw your frozen bird: Top turkey questions Featured on Meta. Now live: A fully responsive profile. I have a directory index configured and every time I click a file it gets downloaded.

I want to tell nginx to show the content for text files instead of downloading them. I still want the download to work when I use wget on those text files. How can I do that? Look here. Add a comment. Active Oldest Votes. Thanks to Sergey Moiseev's comment the answer is quite simple.

Nginx do this in a very simpler way. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name.



0コメント

  • 1000 / 1000