Upload 2 files
Browse files- Dockerfile.txt +5 -0
- nginx.conf.txt +37 -0
Dockerfile.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM nginxinc/nginx-unprivileged:stable-alpine
|
| 2 |
+
# Install nginx and give permissions to 'pn'
|
| 3 |
+
# See https://www.rockyourcode.com/run-docker-nginx-as-non-root-user/
|
| 4 |
+
|
| 5 |
+
COPY nginx.conf /etc/nginx/conf.d/
|
nginx.conf.txt
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
server {
|
| 2 |
+
listen 7860 default_server;
|
| 3 |
+
listen [::]:7860 default_server;
|
| 4 |
+
|
| 5 |
+
server_name _;
|
| 6 |
+
|
| 7 |
+
resolver 1.1.1.1;
|
| 8 |
+
|
| 9 |
+
location /ping {
|
| 10 |
+
default_type application/json;
|
| 11 |
+
return 200 '{"status":"success","result":"nginx json"}';
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
location /api/ip {
|
| 15 |
+
proxy_pass https://api.nn.ci/ip;
|
| 16 |
+
add_header x-url $arg_url;
|
| 17 |
+
proxy_http_version 1.1;
|
| 18 |
+
proxy_set_header Upgrade $http_upgrade;
|
| 19 |
+
proxy_set_header Connection 'upgrade';
|
| 20 |
+
proxy_cache_bypass $http_upgrade;
|
| 21 |
+
proxy_read_timeout 86400;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
location / {
|
| 25 |
+
proxy_pass $arg_url;
|
| 26 |
+
add_header x-url $arg_url;
|
| 27 |
+
proxy_http_version 1.1;
|
| 28 |
+
proxy_set_header Upgrade $http_upgrade;
|
| 29 |
+
proxy_set_header Connection 'upgrade';
|
| 30 |
+
proxy_cache_bypass $http_upgrade;
|
| 31 |
+
proxy_read_timeout 86400;
|
| 32 |
+
add_header Cache-control max-age=2592000;
|
| 33 |
+
proxy_ssl_server_name on;
|
| 34 |
+
proxy_ssl_verify off;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
}
|