User Tools

Site Tools


nginx:restrict_nginx_to_the_private_network

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
nginx:restrict_nginx_to_the_private_network [2016/10/07 15:59] – created peternginx:restrict_nginx_to_the_private_network [2020/07/26 23:50] (current) – old revision restored (2016/10/07 17:00) 192.99.15.29
Line 20: Line 20:
 In our example, we'd modify the listen directives to look like this: In our example, we'd modify the listen directives to look like this:
  
-/etc/nginx/sites-enabled/default+<file /etc/nginx/sites-enabled/default>
 server { server {
     listen 192.0.2.2:80 default_server;     listen 192.0.2.2:80 default_server;
Line 26: Line 26:
     . . .     . . .
 } }
 +</file>
 +
 Save and close the file when you are finished. Test the file for syntax errors by typing: Save and close the file when you are finished. Test the file for syntax errors by typing:
  
 +<code bash>
 sudo nginx -t sudo nginx -t
 +</code>
 +
 If no errors are shown, restart Nginx to enable the new configuration: If no errors are shown, restart Nginx to enable the new configuration:
  
 +<code bash>
 sudo service nginx restart sudo service nginx restart
 +</code>
 +
nginx/restrict_nginx_to_the_private_network.1475855967.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki