Franchesko
@Franchesko
Верстка сайтов | Разработка сайтов

Настройка NGINX. Не работает сайт. Как правильно настроить?

Привет всем! Купил домен, настроил у него ДНСы, настроил конфиг Nginx в sites-available, сделал симлинк в 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;


}


После сервер ребутнул, но не работает сайт, что я не так сделал? может что-то еще настроить нужно было?

Спасибо.
  • Вопрос задан
  • 10391 просмотр
Пригласить эксперта
Ответы на вопрос 4
@antonsr98
Системный Администратор
Можете написать что пишется в error.log в /home/land_user/project/site_ru/logs/error.log? если его нет то создайте все каталоги что необходими
Ответ написан
HeadOnFire
@HeadOnFire
PHP, Laravel & WordPress Evangelist
1. Какая версия Nginx
2. Базовый конфиг
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;
        }

}


Остальное можно пока отключить и добавлять по мере необходимости.
Ответ написан
falsebyte
@falsebyte
Попробуйте убрать
allow 142.251.184.105;
Ответ написан
agronom93
@agronom93
Саженцы, сады, теплицы, сайт
А где вводятся эти настройки?
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы