Hello! When i load my subdomain.site.com browser asks whether to save the file? Nginx subdomain conf
server {
listen 80;
server_name test.site.com;
root /usr/share/nginx/www/test;
index index.php index.html;
location / {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
This conf works great for non php files(e.g. index.html) What i need to do?
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!
Hi, this is a solution for you: <br> <br>server { <br> listen 80; <br> server_name test.; <br> charset utf-8; <br> <br> location / { <br> root /usr/share/nginx/www/test; <br> index index.html index.htm index.php; <br> } <br> <br> location ~ .php$ { <br> try_files $uri = 404; <br> root /usr/share/nginx/www/test; <br> fastcgi_pass unix:/tmp/php5-fpm.sock; <br> fastcgi_index index.php; <br> fastcgi_split_path_info ^(.+.php)(.)$; <br> fastcgi_param SCRIPT_FILENAME <br> $document_root $fastcgi_script_name; <br> fastcgi_intercept_errors on; <br> include /etc/nginx/fastcgi_params; <br> } <br>} <br> <br>Regards, <br>Leandro Naves
Hello! Thanks for answer. When i restart nginx its failed with error <br> <br>invalid parameter “$fastcgi_script_name”
@Evgenity: Make sure that part is all on one line: <br> <br><pre> <br>fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; <br></pre>
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.