mirror of
https://github.com/chuot/rdio-scanner.git
synced 2026-08-13 08:33:00 -06:00
Add NGINX and Apache HTTP reverse proxy examples
This commit is contained in:
parent
bd560fe57d
commit
f92355592a
11
docs/examples/apache/.htaccess
Normal file
11
docs/examples/apache/.htaccess
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# Create a rdio-scanner subfolder under the DOCUMENT_ROOT and put this file in it.
|
||||
# Don't forget to change 127.0.0.1:3000 to the internal IP of your Rdio Scanner instance.
|
||||
|
||||
DirectoryIndex index.html
|
||||
|
||||
RewriteEngine on
|
||||
|
||||
RewriteCond %{HTTP:CONNECTION} ^upgrade$ [NC,OR]
|
||||
RewriteCond %{HTTP:UPGRADE} ^websocket$ [NC]
|
||||
RewriteRule ^/?(.*)$ ws://127.0.0.1:3000/$1 [P,L]
|
||||
RewriteRule ^/?(.*)$ http://127.0.0.1:3000/$1 [P,L]
|
||||
3
docs/examples/apache/README.md
Normal file
3
docs/examples/apache/README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Apache HTTP server
|
||||
|
||||
Simple Apache HTTP `.htaccess` to reverse proxy to an internal Rdio Scanner instance.
|
||||
3
docs/examples/nginx/README.md
Normal file
3
docs/examples/nginx/README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# NGINX
|
||||
|
||||
Simple NGINX configuration that reverse proxy /rdio-scanner path to an internal instance.
|
||||
61
docs/examples/nginx/nginx.conf
Normal file
61
docs/examples/nginx/nginx.conf
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
worker_processes auto;
|
||||
|
||||
error_log /var/log/nginx/error.log notice;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
upstream rdio-scanner {
|
||||
server 127.0.0.1:3000;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
|
||||
# listen 443 ssl default_server;
|
||||
# listen [::]:443 ssl default_server;
|
||||
#
|
||||
# ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
|
||||
# ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
|
||||
|
||||
root /var/www/html;
|
||||
|
||||
index index.html index.htm;
|
||||
|
||||
server_name _;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
location /rdio-scanner/ {
|
||||
rewrite ^/rdio-scanner/(.*)$ /$1 break;
|
||||
proxy_pass http://rdio-scanner;
|
||||
}
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue