Answer the question
In order to leave comments, you need to log in
nginx setup. The site is not working. How to set up correctly?
Hi all! I bought a domain, set up DNSs for it, set up the Nginx config in sites-available, made a symlink in sites-enabled
server {
listen 127.0.0.1:80;
listen 142.251.184.105:80;
server_name site.ru;
root /home/land_user/project/site_ru/public_html;
access_log /home/land_user/project/site_ru/logs/access.log;
error_log /home/land_user/project/site_ru/logs/error.log;
allow 142.251.184.105;
location / {
index index.php index.html; ## Allow a static html file to be shown first
try_files $uri $uri/ /$uri/index.html #@handler; ## If missing pass the URI to Magento's front handler
expires 30d; ## Assume all files are cachable
}
location ~* \.(ico|gif|jpeg|jpg|png|eot|ttf|swf|woff|svg)$ {
limit_conn slimits 20;
expires 30d;
access_log off;
}
location ~ .php/ {
## Forward paths like /js/index.php/x.js to relevant handler
rewrite ^(.*.php)/ $1 last;
}
location ~* \.(css|js)$ {
limit_conn slimits 20;
expires 7d;
access_log off;
}
location /. { ## Disable .htaccess and other hidden files
return 404;
}
set $php_value "$php_value \n error_log=/home/land_user/project/site_ru/logs/php.log";
# This includes global php configuration
# It has to be included to each php location
include /etc/nginx/magento/php5-fcgi-magento-live.conf;
# include /etc/nginx/phpmyadmin;
}
Answer the question
In order to leave comments, you need to log in
Can you write what is written in error.log in /home/land_user/project/site_ru/logs/error.log? if not, then create all the directories you need
1. What version of Nginx
2. Basic config
server {
listen 80;
server_name example.com;
root /var/www/example.com/httpdocs;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
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;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question