Differences

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

Link to this comparison view

Both sides previous revision Previous revision
blocks:server:nginx [2022-12-13 13:47]
admin [NGINX Reverse Proxy]
blocks:server:nginx [2023-03-16 17:46] (current)
admin Moved "redirect all HTTP" to the bottom
Line 50: Line 50:
  
 Make sure to keep the space  after //server_name// as well as the semicolon after the domain name. Save the result by pressing ctrl-O followed by the Enter key, then exit the //nano// editor by ctrl-X.  Make sure to keep the space  after //server_name// as well as the semicolon after the domain name. Save the result by pressing ctrl-O followed by the Enter key, then exit the //nano// editor by ctrl-X. 
- 
-If you want to use HTTPS for all traffic, edit the file at **/etc/nginx/conf.d/pixilab.conf** by uncommenting (removing the #-signs) the last section under "Redirect ALL http request to https", so the last section in that file looks like this: 
- 
-<code> 
-# Redirect ALL http request to https 
-server { 
-    listen 80 default_server; 
-    server_name _; 
-    return 301 https://$host$request_uri; 
-} 
-</code> 
- 
-Save and exit //nano// again. 
  
 Make sure you've set good, strong passwords on all your Blocks users. Finally, while still as the //root// user, run the following commands, pressing enter after each. The first of these commands checks your new nginx configuration for errors. Pay close attention to any error messages that may appear.  Make sure you've set good, strong passwords on all your Blocks users. Finally, while still as the //root// user, run the following commands, pressing enter after each. The first of these commands checks your new nginx configuration for errors. Pay close attention to any error messages that may appear. 
Line 85: Line 72:
  
 If you get stuck, and need more details, follow the official //certbot// guide found [[https://certbot.eff.org/instructions?ws=nginx&os=debianbuster|here]], keeping in mind that all installations have already been done, so you can skip the first couple of steps. If you get stuck, and need more details, follow the official //certbot// guide found [[https://certbot.eff.org/instructions?ws=nginx&os=debianbuster|here]], keeping in mind that all installations have already been done, so you can skip the first couple of steps.
 +
 +If you want to use HTTPS for all traffic, edit the file at **/etc/nginx/conf.d/pixilab.conf** by uncommenting (removing the #-signs) the last section under "Redirect ALL http request to https", so the last section in that file looks like this:
 +
 +<code>
 +# Redirect ALL http request to https
 +server {
 +    listen 80 default_server;
 +    server_name _;
 +    return 301 https://$host$request_uri;
 +}
 +</code>
 +
 +Save and exit //nano// again, then test your configuration and restart nginx:
 +
 +<code>
 +sudo /sbin/nginx -t
 +sudo systemctl restart nginx
 +</code>
  
 ===Using Local Wifi=== ===Using Local Wifi===