[W0-2] fixing nginx reverse proxy configuration
This commit is contained in:
25
README.md
25
README.md
@@ -18,7 +18,7 @@ First of all put a .webm file named 1.webm in `w0bm-data/b`
|
||||
|
||||
`php7.1 artisan tags`
|
||||
|
||||
Now visit http://localhost:8080
|
||||
Now visit http://localhost:8090
|
||||
|
||||
To get upload working do this
|
||||
|
||||
@@ -38,4 +38,25 @@ root@703c9472fed5:/opt/w0bm/public# chmod -R 777 thumbs/
|
||||
root@703c9472fed5:/opt/w0bm/public# chmod -R 777 b
|
||||
```
|
||||
|
||||
inside the container, it applied to the mount
|
||||
inside the container, it applied to the mount
|
||||
|
||||
# Reverse Proxy
|
||||
|
||||
nginx
|
||||
|
||||
`url = foo.bar`
|
||||
|
||||
```
|
||||
server {
|
||||
server_name $url;
|
||||
…
|
||||
location / {
|
||||
proxy_pass http://localhost:8090;
|
||||
proxy_set_header Host $url;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
sub_filter 'http://' 'https://';
|
||||
sub_filter_types *;
|
||||
sub_filter_once off;
|
||||
}
|
||||
}
|
||||
```
|
@@ -1,43 +1,34 @@
|
||||
|
||||
#w0bm.com
|
||||
server {
|
||||
server_name w0bm.local;
|
||||
server_name _;
|
||||
|
||||
listen 8090;
|
||||
#listen [::]:8443 ssl proxy_protocol;
|
||||
http2 on;
|
||||
|
||||
root /opt/w0bm/public;
|
||||
|
||||
allow all;
|
||||
index index.php;
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
access_log off;
|
||||
client_max_body_size 500M;
|
||||
#add_header 'Access-Control-Allow-Origin' '*';
|
||||
|
||||
location = /database/cNsH4YbaKtwQWsKQk47LVAEJTyt3yi6Cz2npPF9izxJ8q7GWg.php {
|
||||
auth_basic "Restricted Area";
|
||||
auth_basic_user_file /etc/nginx/.htpasswd;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
|
||||
}
|
||||
location ~ \.php$ {
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi.conf;
|
||||
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
|
||||
#fastcgi_param GEOIP_ADDR $remote_addr;
|
||||
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
|
||||
}
|
||||
location ~* \.(?:css|js)$ {
|
||||
gzip on;
|
||||
expires 1y;
|
||||
add_header Cache-Control "public";
|
||||
}
|
||||
location ~* \.(?:jpg|jpeg|gif|png|ico|svg)$ {
|
||||
expires 1M;
|
||||
access_log off;
|
||||
add_header Cache-Control "public";
|
||||
}
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
}
|
||||
|
||||
location /api/video/upload {
|
||||
client_max_body_size 500M;
|
||||
fastcgi_param PHP_VALUE "upload_max_filesize=500M \n post_max_size=500M";
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
|
||||
}
|
||||
|
||||
location /index.php {
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user