Vanilla工程如何设置静态文件夹static

1k 词

修改/config/nginx.conf

加入路由设置
[code]
location /static/ {
alias static/;
}
[/code]

完整的配置文件,如下:
[code]
pid tmp/-nginx.pid;

This number should be at maxium the number of CPU on the server

worker_processes 4;

events {
# Number of connections per worker
worker_connections 4096;
}

http {
# use sendfile
sendfile on;

# Va initialization
{{LUA_PACKAGE_PATH}}
{{LUA_PACKAGE_CPATH}}
{{LUA_CODE_CACHE}}
{{LUA_SHARED_DICT}}
{{INIT_BY_LUA}}
{{INIT_BY_LUA_FILE}}
{{VANILLA_WAF}}
{{ACCESS_BY_LUA}}
{{ACCESS_BY_LUA_FILE}}

server {
    # List port
    listen {{PORT}};
    set $template_root '';

    # Access log with buffer, or disable it completetely if unneeded
    access_log logs/{{VA_ENV}}-access.log combined buffer=16k;
    # access_log off;

    # Error log
    error_log logs/{{VA_ENV}}-error.log;


    # Va runtime
    {{CONTENT_BY_LUA_FILE}}

    // 在此处加入静态链接的设置
    location /static/ {
        alias static/;
    }
}

}
[/code]