[42Seoul/ft_server] nginx ์ค์ ํ์ผ (autoindex / ssl / redirect ์ค์ )
42 SEOUL/๋ฐฐ์ด ๊ฒ๋ค ์ ๋ฆฌ hi._.0seon 2021. 2. 16. 16:04 server { listen 80; listen [::]:80; return 301 https://$host$request_uri; } server { # SSL configuration listen 443 ssl; listen [::]:443 ssl; # ssl setting ssl on; ssl_certificate /etc/ssl/certs/localhost.dev.crt; ssl_certificate_key /etc/ssl/private/localhost.dev.key; # server root directory config root /var/www/html; # Add index.php to the list if you are using PHP # Auto index index index.html index.htm index.nginx-debian.html index.php; server_name ft_server; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404.