본문 바로가기
서버/Nginx3
Amazon Linux 2에서 nginx 설치 Aws ec2에 설치할때 AMI를 Amazon Linux 2를 사용하니, 아래처럼 오류를 뿜으며 nginx가 설치되지 않았다. $ sudo yum install nginx Loaded plugins: extras_suggestions, langpacks, priorities, update-motd No package nginx available. Error: Nothing to do nginx is available in Amazon Linux Extra topic "nginx1" To use, run # sudo amazon-linux-extras install nginx1 Learn more at https://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_E.. 2022. 6. 14.
nginx 재시작 오류 Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details. 위처럼 nginx 시작시 오류가 뜬다면 무엇이 잘못 되었는지 sudo nginx -t 코드를 통해 확인해 볼 수 있다. test@ubuntu:/$ sudo nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful​ 위는 정상 작동시 코드이다. 2021. 10. 17.
nginx certbot 연동 location 블록에는 api 서버 쪽만 proxy pass 해서 쓰고 다른 location 블럭에는 root path로 build 한 react 문서만 가져가게 한다. 위부터 추가 제거 iptables 와 firewalld 두 종류가 있다. 이 글에서는 iptables를 사용했다. // 추가시 iptables -t nat -A PREROUTING -p tcp -d --dport -j DNAT --to-destination : // 삭제시 iptables -t nat -D PREROUTING -p tcp -d --dport -j DNAT --to-destination : 와 만 수정해주면 된다. ec2는 보안그룹에서 해당하는 포트를 열어주면 된다. nginx 버전에 따라 조금 다르다. ( 2종류가 있음.. 2021. 10. 11.