如何在 nginxconf 中傳遞環境變數?

如何在 nginxconf 中傳遞環境變數?

我的 nginxconf 為

location /static/ {
                alias $HOME/code/python/vlists/vlists/static/;
        # if asset versioning is used
        if ($query_string) {
            expires max;
        }
    }

我想從環境中傳遞我的 $HOME ,所以我這樣做

$ sudo -E nginx
nginx: [emerg] unknown "home" variable

如何確保$HOME在 中正確替換nginx.conf

相關內容