MiF36rus
@MiF36rus
Алкоголик

Что сделать чтобы заработал nginx?

Есть сервер nginx со следующим конфигом

server {
	listen 80;
	server_name cloud.marcusmebel.ru;
	return 301 https://$server_name$request_uri;
}
server {
	listen 443 ssl;
	server_name cloud.marcusmebel.ru;
	root /var/www/html/nextcloud;

	index index.php index.html;
	
	access_log  /var/log/nginx/nextcloud.ru.access.log;
	error_log   /var/log/nginx/nextcloud.ru.error.log;

	ssl on;
	ssl_certificate     /etc/letsencrypt/live/cloud.marcusmebel.ru/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/cloud.marcusmebel.ru/privkey.pem;
	ssl_trusted_certificate /etc/letsencrypt/live/cloud.marcusmebel.ru/fullchain.pem;
	ssl_dhparam /etc/ssl/certs/dhparam.pem;
	ssl_session_timeout 5m;
	ssl_ciphers               'EECDH+AESGCM:EECDH+CHACHA20:EECDH+AES256:AES128';
	ssl_protocols              TLSv1 TLSv1.1 TLSv1.2;
	ssl_prefer_server_ciphers on;
	ssl_stapling on;
	ssl_stapling_verify on;
	resolver 8.8.4.4 8.8.8.8;
 
    add_header X-Content-Type-Options nosniff;
    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Robots-Tag none;
    add_header X-Download-Options noopen;
    add_header X-Permitted-Cross-Domain-Policies none;
 
    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }
 
    location = /.well-known/carddav { 
        return 301 $scheme://$host/remote.php/dav; 
    }
    location = /.well-known/caldav { 
        return 301 $scheme://$host/remote.php/dav; 
    }
 
    client_max_body_size 512M;
    fastcgi_buffers 64 4K;
    gzip off;
 
    error_page 403 /core/templates/403.php;
    error_page 404 /core/templates/404.php;
 
    location / {
        rewrite ^ /index.php$uri;
    }
 
    location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
        deny all;
    }
 
    location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
        deny all;
    }
 
    location ~^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {
        include fastcgi_params;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param HTTPS on;
        #Avoid sending the security headers twice
        fastcgi_param modHeadersAvailable true;
        fastcgi_param front_controller_active true;
        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
        fastcgi_intercept_errors on;
        fastcgi_request_buffering off;
    }
 
    location ~ ^/(?:updater|ocs-provider)(?:$|/) {
        try_files $uri/ =404;
        index index.php;
    }
 
    location ~* \.(?:css|js)$ {
        try_files $uri /index.php$uri$is_args$args;
        add_header Cache-Control "public, max-age=7200";
        add_header X-Content-Type-Options nosniff;
        add_header X-Frame-Options "SAMEORIGIN";
        add_header X-XSS-Protection "1; mode=block";
        add_header X-Robots-Tag none;
        add_header X-Download-Options noopen;
        add_header X-Permitted-Cross-Domain-Policies none;
        # Optional: Don't log access to assets
        access_log off;
    }
 
    location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {
        try_files $uri /index.php$uri$is_args$args;
        access_log off;
    }
 
    location ~ \.ht {
        deny all;
    }
 
}


Запускается, логи чистые, но на сайт зайти не могу ERR_CONNECTION_REFUSED
Подскажите пожалуйста в чем может быть проблема?
  • Вопрос задан
  • 686 просмотров
Решения вопроса 1
POS_troi
@POS_troi
СадоМазо Админ, флудер, троль.
Выполните
curl -i cloud.marcusmebel.ru
Если ответит примерно так
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.11.9</center>
</body>
</html>


то делаете так
curl -Li cloud.marcusmebel.ru
если получаете рефуз то проверяйте открытость порта 443 в фаерволе

Ну и service nginx status смотрите на предмет того что сервис действительно запустился без ошибок.
Ответ написан
Пригласить эксперта
Ответы на вопрос 1
А конфиг точно подхватывается?
Ответ написан
Ваш ответ на вопрос

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

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