下一步,下一步,提交即可
配置80端口,监听443,下一步,提交即可
分别添加5555转发到web01,6666转发到web02
下一步,下一步,提交,配置6666端口转发到web02的22端口
下一步,下一步,提交
17、浏览器访问异常,修改web服务器配置文件
浏览器访问,一直转圈,是因为我们web服务器上的php,不会识别https协议,需要修改我们的web上的配置文件
1. [c:\~]$ ssh 8.130.97.32 5555 2. 3. 4. Connecting to 8.130.97.32:5555... 5. Connection established. 6. To escape to local shell, press Ctrl+Alt+]. 7. 8. Last login: Sun Apr 23 20:18:34 2023 from 123.112.17.24 9. 10. Welcome to Alibaba Cloud Elastic Compute Service ! 11. 12. [root@web01 ~]# cat /etc/nginx/conf.d/kod.conf 13. server { 14. listen 80; 15. server_name kod.koten.vip; 16. location / { 17. root /code/kod; 18. index index.php index.html index.htm; 19. } 20. location ~\.php$ { 21. root /code/kod; 22. fastcgi_pass 127.0.0.1:9000; 23. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 24. include fastcgi_params; 25. fastcgi_param HTTPS on; 26. } 27. } 28. [root@web01 ~]# systemctl restart nginx 29. 30. 31. [c:\~]$ ssh 8.130.97.32 6666 32. 33. 34. Connecting to 8.130.97.32:6666... 35. Connection established. 36. To escape to local shell, press Ctrl+Alt+]. 37. 38. Last login: Sun Apr 23 18:23:09 2023 from 123.112.17.24 39. 40. Welcome to Alibaba Cloud Elastic Compute Service ! 41. 42. [root@web02 ~]# cat /etc/nginx/conf.d/kod.conf 43. server { 44. listen 80; 45. server_name kod.koten.vip; 46. location / { 47. root /code/kod; 48. index index.php index.html index.htm; 49. } 50. location ~\.php$ { 51. root /code/kod; 52. fastcgi_pass 127.0.0.1:9000; 53. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 54. include fastcgi_params; 55. fastcgi_param HTTPS on; 56. } 57. } 58. [root@web02 ~]# systemctl restart nginx
浏览器访问,恢复正常,大功告成!
我是koten,10年运维经验,持续分享运维干货,感谢大家的阅读和关注!