nginx打开php变下载,nginx打开php就下载的问题
一打开php文件就是下载 然后百度上说进入/etc/nginx/sites-available 然后把fastcgi_pass 127.0.0.1:9000;还有location ~ \.php$ {前面的#去掉就好了 然后我又试了一下 虽然不提示下载了 但是显示502了 这是为什么?我已经启动了php-fpm怎么还是502呢
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
# Default server configuration
#
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ { //把#去掉了
# include snippets/fastcgi-php.conf;
#
# # With php7.0-cgi alone:
fastcgi_pass 127.0.0.1:9000; //把#去掉了
# # With php7.0-fpm:
# fastcgi_pass unix:/run/php/php7.0-fpm.sock;
} //把#去掉了
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
# listen 80;
# listen [::]:80;
#
# server_name example.com;
#
# root /var/www/example.com;
# index index.html;
#
# location / {
# try_files $uri $uri/ =404;
# }
#}
nginx打开php变下载,nginx打开php就下载的问题相关推荐
- 关于nginx使用反向代理后,打开网页速度反而变慢的问题
用宝塔等工具安装并部署nginx,将web项目部署至nginx上,发现页面打开速度反而迟迟无法打开,这可能是因为访问网址时,需要经过DNS域名解析将网址转换成IP地址,所以我们在nginx配置文件中直 ...
- nginx安装包 linux,Linux(CentOS)环境下安装下载Nginx并配置
1.准备工作 选首先安装这几个软件:GCC,PCRE(Perl Compatible Regular Expression),zlib,OpenSSL. Nginx是C写的,需要用GCC编译:Ngin ...
- Nginx配置文件目录实现pdf文件预览及下载
默认情况下,通过nginx服务器来访问pdf文件,在浏览器上是会直接打开该pdf文件呈现内容的.如果想要访问pdf文件时,实现下载文件的效果,则需要在nginx服务端做一些配置. 以下配置只能下载 n ...
- Windows基于Nginx搭建RTMP流媒体服务器(附带所有组件下载地址及验证方法)
RTMP服务时常用于直播时提供拉流推流传输数据的一种服务.前段时间由于朋友想搭建一套直播时提供稳定数据传输的服务器,所以就研究了一下如何搭建及使用. 1.下载nginx 首先我们要知道一般nginx不 ...
- fastdfs+nginx+keepalived+openoffice+lua 实现文件上传、下载、水印、预览(word、excel、ppt、txt),feign文件上传
前言 最近刚刚实现的文件服务中心,记录一下,为没做过的人提供一下思路,由于本人技术有限,不足之处欢迎批评指正,共同学习,共同进步. 目录 Fastdfs集群搭建 搭建keepalived 实现ngxi ...
- linux下载nginx
1.安装依赖包 //一键安装上面四个依赖 yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel 2.下载并解压安装包 ...
- Nginx在Linux(centos7)环境下的下载与安装
Nginx在Linux(centos7)环境下的下载与安装 一.下载Nginx 1.免费的开源版本官方网址 2.选择需要下载的版本 二.安装Nginx 1.安装前准备(需要安装相关依赖库) 2.安装N ...
- 阳光系统下载 移动硬盘打开很慢怎么办
阳光系统下载 移动硬盘打开很慢怎么办 现在由于移动硬盘的容量越来越大,我们存储视频和照片以及办公文件很多时候都用移动硬盘了,毕竟U盘虽然方便但容易坏,数据不安全,但我们在使用移动硬盘的时候会遇到一些问 ...
- 网站打开速度变慢可以从哪些方面进行分析呢?
相信很多站长在从事网站优化的过程中都会遇到网站打开速度发生变化的问题,时快时慢对用户访问网站造成严重影响,那么到底是哪些方面出现问题呢?下面就针对网站打开速度发生变化的问题进行详细分析,希望可以帮助到 ...
最新文章
- springboot 简单自定义starter - beetl
- 祝天下所有的老师教师节快乐
- 监控 Linux 性能的 18 个命令行工具
- 系统架构设计师考试 重要的部分
- 【华为云技术分享】python教程:猴子补丁
- 【Java数据结构与算法】第九章 顺序查找、二分查找、插值查找和斐波那契查找
- 平台用户实名认证设计流程
- 抛出这8个问题,检验一下你到底会不会ThreadLocal,来摸个底~
- OpenShift 4 - DevSecOps Workshop (10) - 向Stage环境部署应用镜像
- rebots css,我的robots.txt中涉及到.htaccss文件的奇怪https/http错误
- vb中line的用法[转]
- hbase region split 过程(翻译)
- nginx问题一则:nginx路径匹配特殊处理及增加cookie等二三事
- 大脑开发——超右脑觉醒
- 产品读书《演讲的力量》
- 前端向后端传参报415_ajax往后台传json格式数据报415错误
- html怎么设置冻结表格,如何在HTML表格上复制“冻结窗格”功能?
- Android开发 更改返回按钮的图标
- Typo: In word ‘worklist‘
- win10关闭动态磁贴_磁贴怎么用
热门文章
- enigma机加强版:兼容汉语和标点符号、阿拉伯数字
- 键盘摄影:今天老李是一名动物摄影师
- php7.3导入Excel strpos(): Non-string needles will be interpreted as strings in the
- AttributeError: Can‘t pickle local object ‘GeneratorEnqueuer.start.<locals>.data_generator_task‘
- 墨者学院 - PHP代码分析溯源(第2题)
- 你的作品集够好了吗?20份精选UI设计作品集给你灵感
- UI设计师必备|灵感爆表UI作品集
- 计算机硬件系统基础知识
- 【秋招笔试】卓望笔试
- VS误删sln项目文件怎么办