例子:
//nginx代理到8521端口 location /uploads/ { proxy_pass http://127.0.0.1:8521; proxy_connect_timeout 900; proxy_send_timeout 900; proxy_read_timeout 900; send_timeout 900; client_max_body_size 3000m; } //apache再将端口代理到项目目录下 <VirtualHost *:8521> ServerName localhost DocumentRoot /www/wwwroot/ogc/public DirectoryIndex index.html index.php <Directory /www/wwwroot/ogc/public> Options -Indexes +FollowSymlinks AllowOverride All Require all granted LimitRequestBody 2147483648 </Directory> </VirtualHost>
注:
/www/wwwroot/ogc/public
public末尾不加上/时将不包含local
例如:172.0.0.1/uploads/将代理到 /www/wwwroot/ogc/public/uploads/
若加上/将包含local
例如:172.0.0.1/uploads/ 将代理到 /www/wwwroot/ogc/public/