netang

nginx setup and conf

Aug 27th, 2020 (edited)
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.62 KB | None | 0 0
  1. # install and set up Nginx on CentOS 8
  2. sudo dnf install nginx
  3. sudo systemctl enable nginx
  4. sudo systemctl start nginx
  5. sudo firewall-cmd --permanent --add-service=http
  6. sudo firewall-cmd --permanent --list-all
  7. sudo firewall-cmd --reload
  8.  
  9. # edit configuration
  10. sudo nano /etc/nginx/nginx.conf
  11.  
  12. # The simplest configuration for load balancing
  13. http {
  14.     upstream automall_app {
  15.         server 127.0.0.1:5001;
  16.         #server x.x.x.x:17032;
  17.     }
  18.  
  19.     server {
  20.         listen 5000;
  21.  
  22.         location / {
  23.             proxy_pass http://automall_app;
  24.         }
  25.     }
  26. }
  27.  
  28.  
  29.  
  30. # stop nginx
  31. sudo systemctl stop nginx
  32.  
Add Comment
Please, Sign In to add comment