nginx에서 짧은주소 적용하는법을 깃허브에서 찾아서 하는데 자동설치스크립트로 설치해서 이미세팅이 된상태에서 임의로수정 하니깐 nginx가 오류나서 구동이 안됩니다. 지금은 다시원상복구한상태이고요 어떤부분을 수정해야 되는지 질문합니다.

 

server {
    listen       80;
    server_name  xxxxx.kr;

    return       301 https://xxxxx.kr$request_uri;
}

server {
    listen       443 ssl http2;
    server_name  xxxxx.kr;
    root   /home/webuser/app/public;

    access_log /home/webuser/log/access.log;
    error_log  /home/webuser/log/error.log warn;

    ssl_certificate /etc/letsencrypt/live/xxxxx.kr/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/xxxxx.kr/privkey.pem;
    ssl_dhparam /etc/ssl/certs/dhparam.pem;

    # Enable HSTS. This forces SSL on clients that respect it, most modern browsers. The includeSubDomains flag is optional.
    add_header Strict-Transport-Security 'max-age=63072000';
    add_header X-Frame-Options SAMEORIGIN;
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection '1;mode=block';

    # Set caches, protocols, and accepted ciphers. This config will merit an A+ SSL Labs score.
    ssl_session_cache shared:SSL:20m;
    ssl_session_timeout 10m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_ciphers 'ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5';

    location / {
        index  index.php index.html;
        try_files $uri $uri/ /index.php?$args;
    }

    # Allow Lets Encrypt Domain Validation Program
    location ^~ /.well-known/acme-challenge/ {
        allow all;
    }

    # Block dot file (.htaccess .htpasswd .svn .git .env and so on.)
    location ~ /\. {
        deny all;
    }

    # Block (log file, binary, certificate, shell script, sql dump file) access.
    location ~* \.(log|binary|pem|enc|crt|conf|cnf|sql|sh|key)$ {
        deny all;
    }

    # Block access
    location ~* (composer\.json|contributing\.md|license\.txt|readme\.rst|readme\.md|readme\.txt|copyright|artisan|gulpfile\.js|package\.json|phpunit\.xml)$ {
        deny all;
    }

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /robots.txt {
        log_not_found off;
        access_log off;
    }

    # cache expires 1 year
    location ~ [^/]\.(css|js|gif|png|jpg|jpeg|eot|svg|ttf|woff|woff2|otf)(/|$) {
        access_log off;
        add_header Cache-Control must-revalidate;
        expires 1y;
        etag on;
    }

    # Block .php file inside upload folder. uploads(wp), files(drupal, xe), data(gnuboard).
    location ~* /(?:uploads|files|data|upload)/.*\.php$ {
        deny all;
    }

    # Add PHP handler
    location ~ [^/]\.php(/|$) {
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        if (!-f $document_root$fastcgi_script_name) {
            return 404;
        }

        fastcgi_pass unix:/run/php/webuser.sock;
        fastcgi_index index.php;
        fastcgi_buffers 64 16k;

        include fastcgi_params;
    }
}