Nginx link downloads file






















The answer above seemed to comment out too much for the solution I reached. This is what my file looked like:. For anyone having same issue with PHP 7, this is what I done to make nginx execute php files properly in CentOS 7, posted here so in case of anyone having same problem:. Follow step by step this document on Digital Ocean. Restart Nginx and PHP services sudo systemctl restart php-fpm and sudo systemctl restart nginx.

Last but most important, clear browser cache or running in incognito Chrome or Private Browsing Firefox etc So this is what finally worked in my case as rewrite rules where the culprit I changed the nginx rewrite rules as follows.. Apparently without the last keyword, the request didn't get restarted, so it never hit the.

If anything else doesn't help you. And maybe earlier you installed apache2 with info. Just clear App Data cache,cookie for localhost. I got the same situation. After I rename the my config file from myfoo to myfoo. Do not forget to restart nginx after rename it. I was about to go mental trying to fix this, for me the issue was that Cloudflare had cached the php file and kept making me download it. I had been having the same problem what solved it was this server block also have this block above other location blocks if you have css not loading issues.

Which I added to my sites-available conf file. I was setting up this server primarily for email and didn't have any use for PHP when I first installed nginx just as a way to run certbot more easily.

For the record, I found that my php-fpm was not running and I fixed it with service php7. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Nginx serves. Asked 7 years, 2 months ago.

Active 2 months ago. Viewed k times. Others "location" are commented Improve this question. Paulo Boaventura 1, 1 1 gold badge 7 7 silver badges 26 26 bronze badges. Apeiron Apeiron 1, 2 2 gold badges 11 11 silver badges 21 21 bronze badges. That's all we can tell you though since you didn't show us any of your config. Thanks Brad — Apeiron. Whichever file or files you put your config in. The relevant part being Show 4 more comments.

Active Oldest Votes. Improve this answer. Jack M. Joy, tried your suggestion but it didn't worked. I prefer cURL to Postman for debugging. Actually I seek help from nginx-upload-module at first. It was an awesome module.

However, the owner is no longer maintaining this module. Below is what I tried with this module which may be helpful in case you want to play with it yourself. You should download branch 2. There is a compile error: md5. Here is a simple patch which fixes this problem: fix-md5. This module is typlically used to handle file uploads without passing them to backend server. Here is a simple example from this module with slight modification. Subdirectories 1 and 05 are both randomly selected and should exist before uploading.

Hashed subdirectory is optional. 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. Hacktoberfest Contribute to Open Source. Requests are not working php laravel Question. PHP execution on nginx - files being downloaded instead Question. Posted June 30, Add a comment. Subscribe Subscribed. Submit an Answer Submit an answer. DreamplaySE June 30, Reply Report.

DreamplaySE You can use root or alias within the location block to set the path though you should only use one or the other, not both — alias is often preferred root is generally used to set the high-level path, outside of location blocks.



0コメント

  • 1000 / 1000