• Welcome to nginx - как попасть на сайт?

    raebg
    @raebg Автор вопроса
    vreitech, grep -P -re '^[^#].*?oot\s+\/var\/www\/html' /etc/nginx
    /etc/nginx/sites-available/default: root /var/www/html;
    /etc/nginx/sites-available/default: root /var/www/html;
    /etc/nginx/sites-available/postal.domayn.ru: root /var/www/html;
    /etc/nginx/sites-available/postal.domayn.ru: root /var/www/html;
  • Welcome to nginx - как попасть на сайт?

    raebg
    @raebg Автор вопроса
    vreitech, я только в эту вносил изменения строку
    server_name _; #postal.domayn.ru; уже не помню что там стояло, но тоже не рабочее, помоему вообще левый домен по умолчанию инсталятора
  • Welcome to nginx - как попасть на сайт?

    raebg
    @raebg Автор вопроса
    vreitech, не чего не вывел
    root@domayn:~# grep -re /root/var/www /etc/nginx
    root@domayn:~#
  • Welcome to nginx - как попасть на сайт?

    raebg
    @raebg Автор вопроса
    vreitech,
    # configuration file /etc/nginx/sites-enabled/default:
    ##
    # You should look at the following URL's in order to grasp a solid understanding
    # of Nginx configuration files in order to fully unleash the power of Nginx.
    # http://wiki.nginx.org/Pitfalls
    # http://wiki.nginx.org/QuickStart
    # http://wiki.nginx.org/Configuration
    #
    # Generally, you will want to move this file somewhere, and start with a clean
    # file but keep this around for reference. Or just disable in sites-enabled.
    #
    # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
    ##
    
    # Default server configuration
    #
    server {
            listen 80 default_server;
            listen [::]:80 default_server;
    
            # SSL configuration
            #
            # listen 443 ssl default_server;
            # listen [::]:443 ssl default_server;
            #
            # Note: You should disable gzip for SSL traffic.
            # See: https://bugs.debian.org/773332
            #
            # Read up on ssl_ciphers to ensure a secure configuration.
            # See: https://bugs.debian.org/765782
            #
            # Self signed certs generated by the ssl-cert package
            # Don't use them in a production server!
            #
            # include snippets/snakeoil.conf;
    
            root /var/www/html;
    
            # Add index.php to the list if you are using PHP
            index index.html index.htm index.nginx-debian.html;
    
            server_name _;
    
            location / {
                    # First attempt to serve request as file, then
                    # as directory, then fall back to displaying a 404.
                    try_files $uri $uri/ =404;
            }
    
            # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
            #
            #location ~ \.php$ {
            #       include snippets/fastcgi-php.conf;
            #
            #       # With php7.0-cgi alone:
            #       fastcgi_pass 127.0.0.1:9000;
            #       # With php7.0-fpm:
            #       fastcgi_pass unix:/run/php/php7.0-fpm.sock;
            #}
    
            # deny access to .htaccess files, if Apache's document root
            # concurs with nginx's one
            #
            #location ~ /\.ht {
            #       deny all;
            #}
    }
    
    
    # Virtual Host configuration for example.com
    #
    # You can move that to a different file under sites-available/ and symlink that
    # to sites-enabled/ to enable it.
    #
    #server {
    #       listen 80;
    #       listen [::]:80;
    #
    #       server_name example.com;
    #
    #       root /var/www/example.com;
    #       index index.html;
    #
    #       location / {
    #               try_files $uri $uri/ =404;
    #       }
    #}
    
    server {
            listen 80 ;
            listen [::]:80 ;
    
            # SSL configuration
            #
            # listen 443 ssl default_server;
            # listen [::]:443 ssl default_server;
            #
            # Note: You should disable gzip for SSL traffic.
            # See: https://bugs.debian.org/773332
            #
            # Read up on ssl_ciphers to ensure a secure configuration.
            # See: https://bugs.debian.org/765782
            #
            # Self signed certs generated by the ssl-cert package
            # Don't use them in a production server!
            #
            # include snippets/snakeoil.conf;
    
            root /var/www/html;
    
            # Add index.php to the list if you are using PHP
            index index.html index.htm index.nginx-debian.html;
        server_name postal.domayn.ru; # managed by Certbot
    
    
            location / {
                    # First attempt to serve request as file, then
                    # as directory, then fall back to displaying a 404.
                    try_files $uri $uri/ =404;
            }
    
            # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
            #
            #location ~ \.php$ {
            #       include snippets/fastcgi-php.conf;
            #
            #       # With php7.0-cgi alone:
            #       fastcgi_pass 127.0.0.1:9000;
            #       # With php7.0-fpm:
            #       fastcgi_pass unix:/run/php/php7.0-fpm.sock;
            #}
    
            # deny access to .htaccess files, if Apache's document root
            # concurs with nginx's one
            #
            #location ~ /\.ht {
            #       deny all;
            #}
    
    
        listen [::]:443 ssl ipv6only=on; # managed by Certbot
        listen 443 ssl; # managed by Certbot
        ssl_certificate /etc/letsencrypt/live/postal.domayn.ru/fullchain.pem; # managed by Certbot
        ssl_certificate_key /etc/letsencrypt/live/postal.domayn.ru/privkey.pem; # managed by Certbot
        include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
    
    }
    # configuration file /etc/letsencrypt/options-ssl-nginx.conf:
    # This file contains important security parameters. If you modify this file
    # manually, Certbot will be unable to automatically provide future security
    # updates. Instead, Certbot will print and log an error message with a path to
    # the up-to-date file that you will need to refer to when manually updating
    # this file.
    
    ssl_session_cache shared:le_nginx_SSL:1m;
    ssl_session_timeout 1440m;
    
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    
    ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS";
  • Welcome to nginx - как попасть на сайт?

    raebg
    @raebg Автор вопроса
    vreitech,
    nginx -T
    nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
    nginx: configuration file /etc/nginx/nginx.conf test is successful
    # configuration file /etc/nginx/nginx.conf:
    user www-data;
    worker_processes auto;
    pid /run/nginx.pid;
    
    events {
            worker_connections 768;
            # multi_accept on;
    }
    
    http {
    
            ##
            # Basic Settings
            ##
    
            sendfile on;
            tcp_nopush on;
            tcp_nodelay on;
            keepalive_timeout 65;
            types_hash_max_size 2048;
            # server_tokens off;
    
             server_names_hash_bucket_size 64;
            # server_name_in_redirect off;
    
            include /etc/nginx/mime.types;
            default_type application/octet-stream;
    
            ##
            # SSL Settings
            ##
    
            ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
            ssl_prefer_server_ciphers on;
    
            ##
            # Logging Settings
            ##
    
            access_log /var/log/nginx/access.log;
            error_log /var/log/nginx/error.log;
    
            ##
            # Gzip Settings
            ##
    
            gzip on;
            gzip_disable "msie6";
    
            # gzip_vary on;
            # gzip_proxied any;
            # gzip_comp_level 6;
            # gzip_buffers 16 8k;
            # gzip_http_version 1.1;
            # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
    
            ##
            # Virtual Host Configs
            ##
    
            include /etc/nginx/conf.d/*.conf;
            include /etc/nginx/sites-enabled/*;
    }
    
    
    #mail {
    #       # See sample authentication script at:
    #       # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
    #
    #       # auth_http localhost/auth.php;
    #       # pop3_capabilities "TOP" "USER";
    #       # imap_capabilities "IMAP4rev1" "UIDPLUS";
    #
    #       server {
    #               listen     localhost:110;
    #               protocol   pop3;
    #               proxy      on;
    #       }
    #
    #       server {
    #               listen     localhost:143;
    #               protocol   imap;
    #               proxy      on;
    #       }
    #}
    
    # configuration file /etc/nginx/mime.types:
    
    types {
        text/html                             html htm shtml;
        text/css                              css;
        text/xml                              xml;
        image/gif                             gif;
        image/jpeg                            jpeg jpg;
        application/javascript                js;
        application/atom+xml                  atom;
        application/rss+xml                   rss;
    
        text/mathml                           mml;
        text/plain                            txt;
        text/vnd.sun.j2me.app-descriptor      jad;
        text/vnd.wap.wml                      wml;
        text/x-component                      htc;
    
        image/png                             png;
        image/tiff                            tif tiff;
        image/vnd.wap.wbmp                    wbmp;
        image/x-icon                          ico;
        image/x-jng                           jng;
        image/x-ms-bmp                        bmp;
        image/svg+xml                         svg svgz;
        image/webp                            webp;
    
        application/font-woff                 woff;
        application/java-archive              jar war ear;
        application/json                      json;
        application/mac-binhex40              hqx;
        application/msword                    doc;
        application/pdf                       pdf;
        application/postscript                ps eps ai;
        application/rtf                       rtf;
        application/vnd.apple.mpegurl         m3u8;
        application/vnd.ms-excel              xls;
        application/vnd.ms-fontobject         eot;
        application/vnd.ms-powerpoint         ppt;
        application/vnd.wap.wmlc              wmlc;
        application/vnd.google-earth.kml+xml  kml;
        application/vnd.google-earth.kmz      kmz;
        application/x-7z-compressed           7z;
        application/x-cocoa                   cco;
        application/x-java-archive-diff       jardiff;
        application/x-java-jnlp-file          jnlp;
        application/x-makeself                run;
        application/x-perl                    pl pm;
        application/x-pilot                   prc pdb;
        application/x-rar-compressed          rar;
        application/x-redhat-package-manager  rpm;
        application/x-sea                     sea;
        application/x-shockwave-flash         swf;
        application/x-stuffit                 sit;
        application/x-tcl                     tcl tk;
        application/x-x509-ca-cert            der pem crt;
        application/x-xpinstall               xpi;
        application/xhtml+xml                 xhtml;
        application/xspf+xml                  xspf;
        application/zip                       zip;
    
        application/octet-stream              bin exe dll;
        application/octet-stream              deb;
        application/octet-stream              dmg;
        application/octet-stream              iso img;
        application/octet-stream              msi msp msm;
    
        application/vnd.openxmlformats-officedocument.wordprocessingml.document    docx;
        application/vnd.openxmlformats-officedocument.spreadsheetml.sheet          xlsx;
        application/vnd.openxmlformats-officedocument.presentationml.presentation  pptx;
    
        audio/midi                            mid midi kar;
        audio/mpeg                            mp3;
        audio/ogg                             ogg;
        audio/x-m4a                           m4a;
        audio/x-realaudio                     ra;
    
        video/3gpp                            3gpp 3gp;
        video/mp2t                            ts;
        video/mp4                             mp4;
        video/mpeg                            mpeg mpg;
        video/quicktime                       mov;
        video/webm                            webm;
        video/x-flv                           flv;
        video/x-m4v                           m4v;
        video/x-mng                           mng;
        video/x-ms-asf                        asx asf;
        video/x-ms-wmv                        wmv;
        video/x-msvideo                       avi;
    }
  • Welcome to nginx - как попасть на сайт?

    raebg
    @raebg Автор вопроса
    как была заглушка так и осталась.
    я изнчально ставил одной командой, у меня все встало и заработало, после ребута выдавал ошибку

    ostal / 502 Bad Gateway nginx/1.10.3 (Ubuntu), 
    не стартует nginx
    tail -f /var/log/nginx/error.log
    2019/07/28 07:03:01 [error] 1363#1363: *62 connect() failed (111: Connection refused) while connecting to upstream, client: 141.8.183.17, server: postal.yourdomain.com, request: "GET /catalog/upakovka_i_khranenie/shkatulki_dlya_nozhey/ HTTP/1.1", 
    upstream: "127.0.0.1:5000/catalog/upakovka_i_khranenie/shkatu...", host: "damassk.ru"


    тоже рылся не смог разобраться.

    Решил поставить все запчасти отдельно по их расширенному мануало, все встало так же - и заглушка.
    Я postal запускаю - пишет статус run на все.
    попасть в пpostal не как
  • Welcome to nginx - как попасть на сайт?

    raebg
    @raebg Автор вопроса
    vreitech, grep -P -re '(postal\.(domayn|cert)|5000)' /etc/nginx
    /etc/nginx/sites-available/default: server_name postal.domayn.ru; # managed by Certbot
    /etc/nginx/sites-available/default: ssl_certificate /etc/letsencrypt/live/postal.domayn.ru/fullchain.pem; # managed by Certbot
    /etc/nginx/sites-available/default: ssl_certificate_key /etc/letsencrypt/live/postal.domayn.ru/privkey.pem; # managed by Certbot
    /etc/nginx/sites-available/postal.domayn.ru: server_name postal.domayn.ru; # managed by Certbot
    /etc/nginx/sites-available/postal.domayn.ru: ssl_certificate /etc/letsencrypt/live/postal.domayn.ru/fullchain.pem; # managed by Certbot
    /etc/nginx/sites-available/postal.domayn.ru: ssl_certificate_key /etc/letsencrypt/live/postal.domayn.ru/privkey.pem; # managed by Certbot
  • Welcome to nginx - как попасть на сайт?

    raebg
    @raebg Автор вопроса
    vreitech, в мануале есть такое описание

    После установки вы можете изменить конфигурацию сайта по умолчанию, чтобы она соответствовала чему-то подходящему. Репозиторий содержит пример файла конфигурации, который вы можете скопировать на место.

    sudo cp /opt/postal/app/resource/nginx.cfg / etc / nginx / sites-available / default

    есть файл на сервереnginx.cfg
    server {
        listen [::]:80;
        listen 0.0.0.0:80;
        server_name _; #postal.domayn.ru;
        return 301 https://$host$request_uri;
    }
    
    server {
        listen [::]:443 ssl;
        listen 0.0.0.0:443 ssl;
        root /opt/postal/app/public;
        server_name _; #postal.domayn.ru;
        ssl_certificate      ssl/postal.cert;
        ssl_certificate_key  ssl/postal.key;
    
        # Generate using: openssl dhparam 4096 -out /etc/ssl/dhparam.pem
        # ssl_dhparam /etc/ssl/dhparam.pem;
    
        ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
        ssl_prefer_server_ciphers on;
        ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA512:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:ECDH+AESGCM:ECDH+AES256:DH+AESGCM:DH+AES256:RSA+AESGCM:!aNULL:!eNULL:!LOW:!RC4:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS;
    
        location / {
           client_max_body_size 50M;
           try_files $uri $uri/index.html $uri.html @puma;
        }
    
        location /assets {
           add_header Cache-Control max-age=3600;
        }
    
        location @puma {
            proxy_set_header X-Real-IP  $remote_addr;
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto https;
            proxy_pass http://127.0.0.1:5000;
        }
    }
  • Welcome to nginx - как попасть на сайт?

    raebg
    @raebg Автор вопроса
    grep -re -P '(postal\.(domayn|cert)|5000)' /etc/nginx
    grep: (postal\.(domayn|cert)|5000): No such file or directory
    /etc/nginx/proxy_params:proxy_set_header X-Forwarded-Proto $scheme;
  • Welcome to nginx - как попасть на сайт?

    raebg
    @raebg Автор вопроса
    ls -la /etc/nginx/sites-available
    total 16
    drwxr-xr-x 2 root root 4096 Jul 28 18:36 .
    drwxr-xr-x 6 root root 4096 Jul 28 17:09 ..
    -rw-r--r-- 1 root root 3719 Jul 28 17:53 default
    -rw-r--r-- 1 root root 873 Jul 28 18:54 postal.domayn.ru

    ls -la /etc/nginx/sites-enabled
    total 8
    drwxr-xr-x 2 root root 4096 Jul 28 18:47 .
    drwxr-xr-x 6 root root 4096 Jul 28 17:09 ..
    lrwxrwxrwx 1 root root 38 Jul 28 18:47 default -> /etc/nginx/sites-available/example.com
    lrwxrwxrwx 1 root root 43 Jul 28 18:40 postal.domayn.ru -> /etc/nginx/sites-available/postal.domayn.ru
  • Welcome to nginx - как попасть на сайт?

    raebg
    @raebg Автор вопроса
    я не знаю важно нет, он у меня все просил поставить apt-transport-https
    типа нету, но в мануале не чего про нее не сказано.
  • Welcome to nginx - как попасть на сайт?

    raebg
    @raebg Автор вопроса
    ln -la /etc/nginx/sites-available
    ln: invalid option -- 'l'
    Try 'ln --help' for more information.
    ln -la /etc/nginx/sites-enabled
    ln: invalid option -- 'l'
    Try 'ln --help' for more information.
  • Welcome to nginx - как попасть на сайт?

    raebg
    @raebg Автор вопроса
    vreitech, ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
    ln: failed to create symbolic link '/etc/nginx/sites-enabled/default': File exists
    root@domayn:~# systemctl reload nginx
    nginx.service is not active, cannot reload.
  • Welcome to nginx - как попасть на сайт?

    raebg
    @raebg Автор вопроса
    Евгений Матвеев, vreitech, попробовал просписать, выдает ошибку.
    unknown directive "postal.yml" in /etc/nginx/sites-enabled/postal.domayn.ru:8
    nginx: configuration file /etc/nginx/nginx.conf test failed

    создал файл postal.domayn.ru в /etc/nginx/sites-available
    с содержанием (где postal.yml - файл конфигурации)
    server {
    	listen 80 default_server;
    	listen [::]:80 default_server;
    
    
    	root /opt/postal/config;
    	postal.yml index index.html index.htm index.nginx-debian.html;
    
    	server_name _;
    
    	location / {
    		try_files $uri $uri/ =404;
    	}
    
    }
    
    
    server {
    	listen 80 ;
    	listen [::]:80 ;
    
    	root /opt/postal/config;
    	postal postal.yml index index.html index.htm index.nginx-debian.html;
        server_name postal.domayn.ru; # managed by Certbot
    
    
    	location / {
    		try_files $uri $uri/ =404;
    	}
    
    
        listen [::]:443 ssl ipv6only=on; # managed by Certbot
        listen 443 ssl; # managed by Certbot
        ssl_certificate /etc/letsencrypt/live/postal.domayn.ru/fullchain.pem; # managed by Certbot
        ssl_certificate_key /etc/letsencrypt/live/postal.domayn.ru/privkey.pem; # managed by Certbot
        include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
    
    }
  • Welcome to nginx - как попасть на сайт?

    raebg
    @raebg Автор вопроса
    vreitech, тут у меня настройки /opt/postal/config/postal.yml
  • Welcome to nginx - как попасть на сайт?

    raebg
    @raebg Автор вопроса
    vreitech, grep -re "server_name postal.domayn.ru" /etc/nginx
    /etc/nginx/sites-available/default: server_name postal.domayn.ru; # managed by Certbot

    ls -la /etc/nginx
    total 64
    drwxr-xr-x 6 root root 4096 Jul 28 17:09 .
    drwxr-xr-x 85 root root 4096 Jul 28 17:06 ..
    drwxr-xr-x 2 root root 4096 Nov 6 2018 conf.d
    -rw-r--r-- 1 root root 1077 Feb 12 2017 fastcgi.conf
    -rw-r--r-- 1 root root 1007 Feb 12 2017 fastcgi_params
    -rw-r--r-- 1 root root 2837 Feb 12 2017 koi-utf
    -rw-r--r-- 1 root root 2223 Feb 12 2017 koi-win
    -rw-r--r-- 1 root root 3957 Feb 12 2017 mime.types
    -rw-r--r-- 1 root root 1462 Feb 12 2017 nginx.conf
    -rw-r--r-- 1 root root 180 Feb 12 2017 proxy_params
    -rw-r--r-- 1 root root 636 Feb 12 2017 scgi_params
    drwxr-xr-x 2 root root 4096 Jul 28 17:37 sites-available
    drwxr-xr-x 2 root root 4096 Jul 28 15:57 sites-enabled
    drwxr-xr-x 2 root root 4096 Jul 28 15:57 snippets
    -rw-r--r-- 1 root root 664 Feb 12 2017 uwsgi_params
    -rw-r--r-- 1 root root 3071 Feb 12 2017 win-utf
  • Welcome to nginx - как попасть на сайт?

    raebg
    @raebg Автор вопроса
    Алексей Долгов, то что тут указано то он и показывает
    root /var/www/html;

    а как узнать свою директорию и индекс что бы прописать, у меня не сайт а почтовый сервер разворачивали POSTAl у него посвоему там пути и папки, в мануале по этиому вопросу не чего нет.
  • Welcome to nginx - как попасть на сайт?

    raebg
    @raebg Автор вопроса
    Алексей Долгов, я не особо в нем пойму
    server {
    listen 80 default_server;
    listen [::]:80 default_server;

    # SSL configuration
    #
    # listen 443 ssl default_server;
    # listen [::]:443 ssl default_server;
    #
    # Note: You should disable gzip for SSL traffic.
    # See: https://bugs.debian.org/773332
    #
    # Read up on ssl_ciphers to ensure a secure configuration.
    # See: https://bugs.debian.org/765782
    #
    # Self signed certs generated by the ssl-cert package
    # Don't use them in a production server!
    #
    # include snippets/snakeoil.conf;

    root /var/www/html;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html;

    server_name _;

    location / {
    # First attempt to serve request as file, then
    # as directory, then fall back to displaying a 404.
    try_files $uri $uri/ =404;
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    # include snippets/fastcgi-php.conf;
    #
    # # With php7.0-cgi alone:
    # fastcgi_pass 127.0.0.1:9000;
    # # With php7.0-fpm:
    # fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    # deny all;
    #}
    }

    # Virtual Host configuration for example.com
    #
    # You can move that to a different file under sites-available/ and symlink that
    # to sites-enabled/ to enable it.
    #
    #server {
    # listen 80;
    # listen [::]:80;
    #
    # server_name example.com;
    #
    # root /var/www/example.com;
    # index index.html;
    #
    # location / {
    # try_files $uri $uri/ =404;
    # }
    #}

    server {
    listen 80 ;
    listen [::]:80 ;

    # SSL configuration
    #
    # listen 443 ssl default_server;
    # listen [::]:443 ssl default_server;
    #
    # Note: You should disable gzip for SSL traffic.
    # See: https://bugs.debian.org/773332
    #
    # Read up on ssl_ciphers to ensure a secure configuration.
    # See: https://bugs.debian.org/765782
    #
    # Self signed certs generated by the ssl-cert package
    # Don't use them in a production server!
    #
    # include snippets/snakeoil.conf;

    root /var/www/html;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html;
    server_name postal.domayn.ru; # managed by Certbot

    location / {
    # First attempt to serve request as file, then
    # as directory, then fall back to displaying a 404.
    try_files $uri $uri/ =404;
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    # include snippets/fastcgi-php.conf;
    #
    # # With php7.0-cgi alone:
    # fastcgi_pass 127.0.0.1:9000;
    # # With php7.0-fpm:
    # fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    # deny all;
    #}

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/postal.domayn.ru/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/postal.domayn.ru/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    }
  • Welcome to nginx - как попасть на сайт?

    raebg
    @raebg Автор вопроса
    netstat -ntlp | grep LISTEN
    tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      729/nginx -g daemon
    tcp        0      0 0.0.0.0:4369            0.0.0.0:*               LISTEN      743/epmd
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      630/sshd
    tcp        0      0 127.0.0.1:5000          0.0.0.0:*               LISTEN      1126/[postal] web.1
    tcp        0      0 0.0.0.0:25672           0.0.0.0:*               LISTEN      928/beam
    tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      911/mysqld
    tcp6       0      0 :::80                   :::*                    LISTEN      729/nginx -g daemon
    tcp6       0      0 :::4369                 :::*                    LISTEN      743/epmd
    tcp6       0      0 :::22                   :::*                    LISTEN      630/sshd
    tcp6       0      0 :::25                   :::*                    LISTEN      1132/[postal] smtp.
    tcp6       0      0 :::5672                 :::*                    LISTEN      928/beam
  • Postal / 502 Bad Gateway nginx/1.10.3 (Ubuntu), как исправить?

    raebg
    @raebg Автор вопроса
    его с коробки поставил - все ок, зашел.
    Перезагрузил сервер - и такая ошибка - 502 Bad Gateway nginx/1.10.3 (Ubuntu)
    делаю
    tail -f /var/log/nginx/error.log
    2019/07/28 07:03:01 [error] 1363#1363: *62 connect() failed (111: Connection refused) while connecting to upstream, client: 141.8.183.17, server: postal.yourdomain.com, request: "GET /catalog/upakovka_i_khranenie/shkatulki_dlya_nozhey/ HTTP/1.1",
    upstream: "127.0.0.1:5000/catalog/upakovka_i_khranenie/shkatu...", host: "damassk.ru"