Answer the question
In order to leave comments, you need to log in
Nginx: upstream and proxy_pass?
Ubuntu 12.04 x64, DigitalOcean.
Installed nginx+Apache+PHP, static is not given at all, proxy_pass value instead of any urls. Set up according to this guide .
/etc/nginx/nginx.conf
user www-data;
worker_processes 1;
pid /var/run/nginx.pid;
error_log /home/project/logs/nginx.error.log;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
gzip_proxied any;
gzip_comp_level 7; #Level Compress
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascri$
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
upstream project {
server 127.0.0.1:81;
}
server {
listen 80;
error_page 404 /404.html;
error_page 403 /403.html;
server_name project.ru www.project.ru;
access_log /home/project/logs/nginx.access.log;
error_log /home/project/logs/nginx.error.log;
location / {
proxy_pass http://project;
}
location ~* .(jpg|jpeg|gif|png|ico|css|bmp|swf|js|mov|avi|mp4|mpeg4) {
root /home/project/www;
}
location ~ /.ht {
deny all;
}
}
Answer the question
In order to leave comments, you need to log in
static is not given at all
Most likely, you have an error in the line
most likely instead
location ~* \.(jpg|jpeg|gif|png|ico|css|bmp|swf|js|mov|avi|mp4|mpeg4)$ {
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question