Who can help with deploy setup?

Hi all, sorry for this stupid question but I don't know how to figure out this issue.
I can't run my app after changed SSL to certbot.

My domain is: www.airstage.co

My NGINX config:
/etc/nginx/conf.d/airstage.co.conf (it was chenged by certbot)

server {
    server_name airstage.co www.airstage.co;
    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/airstage.co/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/airstage.co/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
server {
    if ($host = www.airstage.co) {
        return 301 https://$host$request_uri;
    } # managed by Certbot
    if ($host = airstage.co) {
        return 301 https://$host$request_uri;
    } # managed by Certbot
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name airstage.co www.airstage.co;
    return 404; # managed by Certbot

And here /etc/nginx/sites-available/default

upstream app {
  server unix:///home/deploy/airstage_web/shared/tmp/sockets/puma.sock fail_timeout=0;
server {
        root /home/deploy/airstage_web/current/public;
        try_files $uri/index.html $uri @app;
        location /home/deploy/airstage_web/current/public {
          autoindex on;
          autoindex_exact_size off;
        location @app {
                proxy_pass http://app;
                proxy_set_header X-Forwarded-Proto https;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $http_host;
                proxy_redirect off;
                proxy_buffer_size 128k;
                proxy_buffers 4 256k;
                proxy_busy_buffers_size 256k;
        location ^~ /assets/ {
                gzip_static on;
                expires max;
                add_header Cache-Control public;
        error_page 500 502 503 504 /500.html;
        client_max_body_size 1G;
        keepalive_timeout 10;

This all returned me Welcome to nginx! page or if I moved root path to nginx/conf.d/airstage.co.conf

[error] 14714#14714: *763 directory index of "/home/deploy/airstage_web/current/public/" is forbidden, client: My_IP, server: airstage.co, request: "GET / HTTP/1.1", host: "www.airstage.co"

Rails application, deployed by capistrano

My web server is (include version): nginx/1.10.3 (Ubuntu)

The operating system my web server runs on is (include version): Ubuntu 16.04

My hosting provider, if applicable, is: digital ocean

I can login to a root shell on my machine (yes or no, or I don't know): yes

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): certbot 1.15.0

1 Like

It looks like you might need to move the parts from the first server {} block (the port 443 stuff, not port 80) in airstage.co.conf to the server {} block in the default file. Or even better, put the specific stuff from default to airstage.co.conf?

1 Like

Thank you very much, it's helped to me


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.