nginxをリバースプロキシとして使うテストをしています。
nginx.confを下記のように書いたのですが、下記のようなエラーが出てしまいます。
locationディレクティブをどのように書けばnginxを起動できますでしょうか。
nginx.conf
```user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; include /etc/nginx/conf.d/*.conf; location ~ \.php$ { root /var/www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } nginx -t nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) 2015/08/16 16:26:29 [warn] 10838#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:2 2015/08/16 16:26:29 [emerg] 10838#0: "location" directive is not allowed here in /etc/nginx/nginx.conf:32 nginx: configuration file /etc/nginx/nginx.conf test failed
色々な回答がありましたので、現在の nginx.conf と、起動時の問題について、追記されると良いと思います。
まだ回答がついていません
会員登録して回答してみよう