webサーバーのバーチャルホスト内の変数使用可能ですか?

前提

初めまして
OS:RASBERRY PI OS LITE
OpenMediavault6
nginx/1.18.0
上記の条件でwebサーバーのバーチャルホストの設定を作成しています。ルートパス名が長い場合変数に入れて使いたいのですが、可能でしょうか?(外付けドライブをNASで繋いでいる場合、OMVが勝手に長いパスを設定しているので)
apacheではdefineで処理出来る事を知りました。色々調べたのですが思う結果が得られません。ご指導お願いいたします。

発生している問題・エラーメッセージ

下記コードでエラー、#を解除反転でOKです
$ sudo nginx -t ではじかれます

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: [emerg] open() "/usr/share/nginx/$STORAGE_PATH/other/logs/signpost_error.log" failed (2: No such file or directory) nginx: configuration file /etc/nginx/nginx.conf test failed

該当のソースコード

nginx

1 server {2 listen 192.168.11.51:80;3 server_name signpost.com;4   set $STORAGE_PATH /srv/*******************9cb27ffa88/nasFile/WebSite;5  access_log $STORAGE_PATH/other/logs/signpost_access.log;6# access_log /srv/*******************9cb27ffa88/nasFile/WebSite/other/logs/signpost_access.log;7 error_log $STORAGE_PATH/other/logs/signpost_error.log;8 # error_log /srv/*******************9cb27ffa88/nasFile/WebSite/other/logs/signpost_error.log;9 location / {10 root $STORAGE_PATH/signpost/;11 # root /srv/*******************9cb27ffa88/nasFile/WebSite/signpost/;12 index index.html index.php;13 }14 }

試したこと

補足情報(FW/ツールのバージョンなど)

OS:RASBERRY PI OS LITE
OpenMediavault6
nginx/1.18.0

コメントを投稿

0 コメント