nginx ssh配置,larave项目配置多个前端项目
1 ssh 配置
server { listen 443 ssl http2; #listen [::]:80; server_name xiaoqiezia.cn www.xiaoqiezia.cn; index index.html index.htm index.php default.html default.htm default.php; root /home/wwwroot/php-admin/public; # include /usr/local/nginx/conf/white.conf; #deny all; ssl_certificate /usr/local/nginx/conf/ssl/www.xiaoqiezia.cn.pem; ssl_certificate_key /usr/local/nginx/conf/ssl/www.xiaoqiezia.cn.key; ssl_session_timeout 5m; #表示使用的加密套件的类型 ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #表示使用的TLS协议的类型,您需要自行评估是否配置TLSv1.1协议。 ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; ssl_prefer_server_ciphers on; set_real_ip_from 0.0.0.0/0; real_ip_header X-Forwarded-For; include rewrite/laravel.conf; #error_page 404 /404.html; # Deny access to PHP files in specific directory #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; } include enable-php.conf; location ^~ /dist/ { alias /home/wwwroot/php-admin/public/dist/; index index.html index.htm; #return 302 https://xiaoqiezia.cn/ydjf; # proxy_pass http://101.132.106.210:9089/; } location ^~ /mdetail/ { alias /home/wwwroot/php-admin/public/mdetail/; index index.html index.htm ; } location ^~ /autogetmobile/ { alias /home/wwwroot/php-admin/public/autogetmobile/; index index.html index.htm ; } location ^~ /alilogin/ { alias /home/wwwroot/php-admin/public/alilogin/; index test.html test.htm ; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 12h; } location ~ /.well-known { allow all; } location ~ /\. { deny all; } access_log /home/wwwlogs/xiaoqiezia.cn.log; } server { listen 80; server_name xiaoqiezia.cn www.xiaoqiezia.cn; rewrite ^(.*)$ https://$host$1; }
2 laravel项目配置多个前端项目
location ^~ /dist/ { alias /home/wwwroot/php-admin/public/dist/; index index.html index.htm; #return 302 https://xiaoqiezia.cn/ydjf; # proxy_pass http://101.132.106.210:9089/; } location ^~ /mdetail/ { alias /home/wwwroot/php-admin/public/mdetail/; index index.html index.htm ; } location ^~ /autogetmobile/ { alias /home/wwwroot/php-admin/public/autogetmobile/; index index.html index.htm ; }