title: nginx: [emerg] "proxy_cache_path" directive is not allowed here and "server" directive is not allowed here and
body: <p>In order to make changes on the web site I closed the cache then when I tried to open it it gave an error. I saw solutions to that problem on the web such as using htp{}.. etc. But it didn't work as well. It gives an error like; </p>
  
  <blockquote>
    <p>it cannot be reached at that website or declined to connect. </p>
  </blockquote>
  
  <p>And this is not a  problem caused just by the website. It gives the same error in the server that has portals which means I received the same error notification in different apps too.</p>
  
  <p>At dokku there are two different nginx files. One of them I get </p>
  
  <blockquote>
    <p>"server" directive is not allowed here </p>
  </blockquote>
  
  <p>and the other one I get </p>
  
  <blockquote>
    <p>"proxy_cache_path" directive is not allowed here </p>
  </blockquote>
  
  <p>but I think If I can solve one of them system would work again and when I try to open the cache I get "proxy_cache_path" error</p>
  
  <p>In the same time, inside of the  /home/dokku/myapp/nginx  files </p>
  
  <pre><code>include /home/dokku/myapp/nginx.conf.d/*.conf;`error_page 400 401 402 403 405 406 407 408 409 410 411 412 413 414 415 416 417 418 420 422 423 424 426 428 429 431 444 449 450 451 /400-error.html;`location /400-error.html {
      root /var/lib/dokku/data/nginx-vhosts/dokku-errors;
      internal;`part. ``} `
  </code></pre>
  
  <p>However in the /home/dokku/myapp/nginx.conf.d/*.conf; named file there is no file such as I mentioned before is exist  </p>
  
  <p>when I run <code>systemctl status nginx</code> command I got these errors:</p>
  
  <pre><code> Starting A high performance web server and a reverse proxy server...
   nginx[26504]: nginx: [emerg] "proxy_cache_path" directive is not allowed here in /home/dokku/myapp/nginx.conf:93
  nginx[26504]: nginx: configuration file /etc/nginx/nginx.conf test failed
   systemd[1]: nginx.service: Control process exited, code=exited status=1
   systemd[1]: Failed to start A high performance web server and a reverse proxy server.
  systemd[1]: nginx.service: Unit entered failed state.
  systemd[1]: nginx.service: Failed with result 'exit-code'.
  </code></pre>
  
  <p>I tried <code>dokku plugin:uninstall nginx-cache</code> command bur error not resolved</p>
  
  <pre><code>Reloading nginx
  
  nginx: [emerg] "proxy_cache_path" directive is not allowed here in /home/dokku/myapp/nginx.conf:93
  nginx: configuration file /etc/nginx/nginx.conf test failed
         validate_nginx failed. 
  </code></pre>
  
  <p>contents of /home/dokku/muhasebe/nginx.conf below...      </p>
  
  <p>and nginx file 93.row:</p>
  
  <pre><code>proxy_cache_path /tmp/nginx levels:1-2 keys_zone=dokku:10m inactive=60m use_temp_path=off;   
  </code></pre>
  
  <p>( also tmp file is not have nginx file )</p>