A
A
Alexander2015-01-02 17:40:45
Nginx
Alexander, 2015-01-02 17:40:45

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;


}

After the server rebooted, but the site does not work, what did I do wrong? maybe something else needs to be configured?
Thank you.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Anton Ulanov, 2015-01-02
@antonsr98

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

I
Igor Vorotnev, 2015-01-02
@HeadOnFire

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;
        }

}

The rest can be disabled for now and added as needed.

F
falsebyte, 2015-01-02
@falsebyte

Try to remove
allow 142.251.184.105;

A
Alexander Kapshtyk, 2016-01-24
@agronom93

Where are these settings entered?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question