Last modified by Alexandru Pentilescu on 2023/06/25 18:58

From version 5.1
edited by Alexandru Pentilescu
on 2023/01/08 13:41
Change comment: Deleted image "image2.jpg"
To version 6.1
edited by Alexandru Pentilescu
on 2023/06/25 18:58
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -15,13 +15,13 @@
15 15  
16 16  = Mapping a specific URL location to a directory location on the system =
17 17  
18 -Sometimes, you may want a very simple configuration where you have a specific URL location (i.e. **https://pentilescu.com/bin/ **) and you want this URL prefix to indicate to Nginx to use a specific directory on the system to look for the requested files in. Or, in other words, every HTTP GET request sent to **https://pentilescu.com/bin/ ** (e.g. **https://pentilescu.com/bin/folder1/myfile.png **) to be searched for in a specific systems directory (e.g. **/var/www/static/**). This way, a request for **https://pentilescu.com/bin/folder1/myfile.png ** should resolve to **/var/www/static/folder1/myfile.png**. How do we do this?
18 +Sometimes, you may want a very simple configuration where you have a specific URL location (i.e. **https://transistor.one/bin/ **) and you want this URL prefix to indicate to Nginx to use a specific directory on the system to look for the requested files in. Or, in other words, every HTTP GET request sent to **https://transistor.one/bin/ ** (e.g. **https://transistor.one/bin/folder1/myfile.png **) to be searched for in a specific systems directory (e.g. **/var/www/static/**). This way, a request for **https://transistor.one/bin/folder1/myfile.png ** should resolve to **/var/www/static/folder1/myfile.png**. How do we do this?
19 19  
20 20  Simple! We use the "alias" directive, like so!
21 21  
22 22  {{code language="nginx"}}
23 23   server {
24 - server_name pentilescu.com;
24 + server_name transistor.one;
25 25  
26 26   location /robots.txt {
27 27   alias /var/www/static/robots.txt;
... ... @@ -36,7 +36,7 @@
36 36   }
37 37  
38 38   location / {
39 - return 301 https://alexandru.pentilescu.com$request_uri;
39 + return 301 https://alexandru.transistor.one$request_uri;
40 40   }
41 41  
42 42   listen 80;
... ... @@ -62,7 +62,7 @@
62 62  
63 63  {{code language="nginx"}}
64 64  server {
65 - server_name wiki.pentilescu.com;
65 + server_name wiki.transistor.one;
66 66  
67 67   listen [::]:443 ssl http2; # managed by Certbot
68 68   listen 443 ssl http2; # managed by Certbot
... ... @@ -77,7 +77,7 @@
77 77  }
78 78  {{/code}}
79 79  
80 -Here, we set the maximum upload file size to 2.5GB (i.e. 2500 MB). Any upload size greater than this will be rejected for the wiki.pentilescu.com domain.
80 +Here, we set the maximum upload file size to 2.5GB (i.e. 2500 MB). Any upload size greater than this will be rejected for the wiki.transistor.one domain.
81 81  )))
82 82  
83 83