-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add reverse proxy to server management
- Loading branch information
Showing
5 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,5 @@ | |
layout: default | ||
title: User Management | ||
nav_order: 1 | ||
parent: Server Management | ||
has_children: true | ||
--- |
4 changes: 2 additions & 2 deletions
4
_server_management/index.md → _server_management/web_services/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
layout: default | ||
title: Server Management | ||
title: "Web Services" | ||
nav_order: 2 | ||
has_children: true | ||
--- | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
layout: default | ||
title: Reverse Proxies | ||
nav_order: 1 | ||
parent: Web Services | ||
has_children: true | ||
--- |
34 changes: 34 additions & 0 deletions
34
_server_management/web_services/reverse_proxy/rstudio-server.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
layout: default | ||
title: RStudio Server | ||
nav_order: 1 | ||
parent: "Reverse Proxies" | ||
grand_parent: "Web Services" | ||
--- | ||
|
||
As of the date 11/03/2023, I couldn't find a solution to reverse proxy Nginx in an elegant manner. The primary issue is that, for some reason, all static files from the RStudio Server, except HTML, were returning a 404 error. | ||
|
||
However, I eventually discovered a workaround while experimenting with the Nginx configuration file. I added an additional redirect rule specifically for static files. While this solution is not elegant and may potentially expose some vulnerabilities due to changes in the `Content-Security-Policies`, considering that we're only running analyses within an intranet, I don't believe the vulnerability is severe. | ||
|
||
Here's the excerpt from the Nginx site configuration: | ||
|
||
```nginx | ||
location /rstudio/ | ||
{ | ||
rewrite ^/rstudio/(.*)$ /$1 break; | ||
proxy_pass http://localhost:8787; | ||
proxy_http_version 1.1; | ||
add_header Content-Security-Policy "default-src 'self' * 'unsafe-eval' 'unsafe-inline' data:;"; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection $connection_upgrade; | ||
proxy_read_timeout 20d; | ||
proxy_set_header X-RStudio-Request $scheme://$host:$server_port$request_uri; | ||
proxy_set_header X-RStudio-Root-Path /rstudio; | ||
} | ||
location ~ ^/rstudio/(.*(.css|.js|.jpg|.jpeg|.png|.gif|.svg|.ico))$ | ||
{ | ||
proxy_pass http://localhost:8787/$1; | ||
} | ||
``` |