zoukankan      html  css  js  c++  java
  • nginx——部署前端

    nginx容器前端文件目录必须为: /usr/share/nginx/html

    html下面是各种文件:js,css,index.html 等。

    其他报错:

    js 找不到

    解决:更改 vue 中,js 路径,使其符合实际情况

    403

    解决:index.html找不到,路径地址错了

    nginx完整配置文件:

    user  www-data;
    worker_processes  2;
    worker_cpu_affinity  01  10;
    pid        /var/run/nginx.pid;
    error_log  /var/log/nginx/error.log warn;
    
    events {
        use epoll;
        worker_connections  1024;
    }
    
    
    http {
        include       /etc/nginx/mime.types;
        default_type  application/octet-stream;
    
        client_max_body_size 500m;
    
        resolver 10.43.0.10;
        
    
        
        log_format main '$time_local $remote_addr $remote_user $status '
                        '$request_time $request [$body_bytes_sent/$bytes_sent] '
                        '"$http_user_agent" "$http_referer" "$http_x_forwarded_for"';
    
        access_log  /var/log/nginx/access.log  main;
    
        
        sendfile            on;
        tcp_nopush          on;
        keepalive_timeout   65;
        gzip                on;
    
        
        server {
            listen 80;
            server_name  127.0.0.1;
            charset utf-8;
            
            location / {
                root /usr/share/nginx/html;
                index index.html;
                try_files $uri $uri/ =404;
            }
        }
        
        server {
            listen 8002;
            server_name  127.0.0.1;
            charset utf-8;
            location / {
               proxy_pass http://172.19.168.118:8000/;
            }
        }
    }
    
  • 相关阅读:
    Abp Swagger API中文说明配置方法
    ABP框架中使用MySQL数据库
    windows + jenkins + .net core + iis自动化部署新手入门
    在图片上画矩形框
    base64转换成np、opencv、PIL
    RankSVM
    tf.placeholde函数解释与用法
    slim.arg_scope()的使用
    SSD网络结构
    tensorflow学习笔记
  • 原文地址:https://www.cnblogs.com/pythonwl/p/14313804.html
Copyright © 2011-2022 走看看