K
K
kiron2782018-09-20 15:45:32
Nginx
kiron278, 2018-09-20 15:45:32

Hosting websites on VPS?

I'm trying to host a website on a VPS, it already has websites. Instead of executing php files are downloaded. Here is the config for my site, Google did not help, although I went through many options. other sites on this vps work fine.

listen 80;
server_name domain.ru www.domain.ru;
root /var/www/domain.ru;

  location / {
      try_files $uri $uri/ /index.php?q=$uri&$args;
      index   index.html index.php;
    }
    
    location ~ \.php$ { 
      try_files $uri =404; 
      fastcgi_pass unix:/var/run/php5-fpm.sock; 
      include /etc/nginx/fastcgi_params; 
      fastcgi_index index.php; 
      fastcgi_param SCRIPT_FILENAME $request_filename;

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2018-09-20
@dimonchik2013

check the headers, give the correct content type so that the browser understands what to render it

A
Andrey Gavrilov, 2018-09-25
@thexaver

location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
index index.html index.php;
}
try to remove this piece of config

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question