mac 上配置nginx过程中的问题记录
来源:互联网 发布:steam mac 中文游戏 编辑:程序博客网 时间:2024/06/13 16:37
"GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (这里只截取重要部分),搜的结果是权限问题,项目用的是laravel框架,解决办法是给storage/*
directory and bootstrap/cache加上权限,使用命令chmod -R 777 storage。参考来源如下图:
2、favicon.ico 找不到:
解决办法是在nginx的配置文件的server中加上:
location = /favicon.ico {
log_not_found off;
}3、还有一定要注意配置文件中的文件权限和路径问题,很多问题都是因为这引起的。
4、我nginx的配置的代码如下(nginx.conf):
user wyung staff;
worker_processes auto;
error_log /usr/local/etc/nginx/logs/error.log;
#error_log /usr/local/etc/nginx/logs/error.log notice;
error_log /usr/local/etc/nginx/logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 256;
}
http {
include 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 logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 8080;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm index.php;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location = /favicon.ico {
log_not_found off;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
include servers/*;
}
5、servers文件夹中的一个子配置代码如下:
server {
listen 10001;
set $root_path '/Users/wyung/sdnm/sdnm_0.5/public';
root $root_path;
index index.php index.html index.htm;
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php($|/) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index /index.php;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
#fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
location ~/\.ht {
deny all;
}
access_log /usr/local/etc/nginx/servers/access.log;
error_log /usr/local/etc/nginx/servers/error.log;
}
- mac 上配置nginx过程中的问题记录
- Nginx配置过程中问题记录
- dorado7配置过程中的问题记录
- mac上php+nginx配置
- 记录nginx配置php7过程
- nginx在mac中的配置
- thinkcmf5 nginx配置pathinfo和安装过程中的问题
- Nginx在Mac上的安装配置
- 08-nginx网站的配置过程记录
- 记录FastDFS+Nginx 安装与配置过程
- Mac java环境变量配置过程记录
- 开发过程中的问题记录
- Mac上配置svn服务器的过程
- 在Mac上安装配置OpenFire过程
- mac配置apache+php+mysql问题记录
- Mac配置PHP遇到的问题记录
- Mac上安装Nginx
- Mac上安装nginx
- 希云cSphere更新--提供容器落地的整体解决方案
- jQuery对象和DOM对象
- 初学PX4之环境搭建
- LeetCode416
- LeetCode | 743. Network Delay Time | 中等难度 图论 单源最短路径题
- mac 上配置nginx过程中的问题记录
- 手机的100种玩法,程序员你是怎么“善待”你的手机的?
- Jfinal---模拟redis插件写一个连接多个memcahe的插件
- 扫码领红包 无需消费即可轻松提现 附教程
- Bootstrap 3.x 打印问题 打印无法显示背景、字体变黑
- HTML5移动开发的10大移动APP开发框架
- 结构体与byte数组转换/结构体内定长数组
- linux 僵尸进程
- NKOJ 2844 (APIO 2014)回文串(Manacher+后缀自动机+倍增/回文树)