0

In my \homepage\app\views is lying my index.html, which acan be loaded if i start localhost. now the problem is that i cant figure out how to link to css files since they are lying under: homepage\app\assets\stylesheets

And my Php is lying under : homepage\testApp

index  /index.scala.html;
root homepage\app\views;
location / {


        }

the code above is working which links to index, but it cant load css, javalibrarys or anything else. Any ideas how i can link to them?

P.S. I am a beginner to nginx

1 Answer 1

1

# serve static files

  location ~ ^/(images|javascript|js|css|flash|media|static)/  {
      root    homepage\app\assets\stylesheets;
              *#/var/www/virtual/big.server.com/htdocs;*
      expires 30d;
    }

if you need some special files serving from this directory you can simply add them to this list.

About php: Nginx was designed for serving static files. Therefore it can not handle php files. For php files you need to use a backed. Here you have two ordinary solutions: apache(httpd) or php5-fpm.

 server { # php/fastcgi
    listen       80;
    server_name  domain1.com www.domain1.com;
    access_log   logs/domain1.access.log  main;
    root         html;

    location ~ \.php$ {
      fastcgi_pass   127.0.0.1:1025;
    }

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .