在win nginx下配置symfony3.4,并隐藏项目名称 .php入口   记录下

#  power by www.php.cn
#user nobody;
worker_processes 1; #error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info; #pid logs/nginx.pid; events {
worker_connections 1024;
} 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;
#tcp_nodelay on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 128k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k; #gzip on;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 32k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
gzip_disable "MSIE [1-6]."; server_names_hash_bucket_size 128;
client_max_body_size 100m;
client_header_buffer_size 256k;
large_client_header_buffers 4 256k; server {
server_name yourdomain.com;
root "E:/phpStudy/PHPTutorial/WWW/yourProjectPath/web"; location / {
index app.php;
try_files $uri @rewriteapp;
} location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
# DEV
# This rule should only be placed on your development environment
# In production, don't include this and don't deploy app_dev.php or config.php
location ~ ^/(app_dev|config)\.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
# When you are using symlinks to link the document root to the
# current version of your application, you should pass the real
# application path instead of the path to the symlink to PHP
# FPM.
# Otherwise, PHP's OPcache may not properly detect changes to
# your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
# for more information).
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
}
# PROD
location ~ ^/app\.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
# When you are using symlinks to link the document root to the
# current version of your application, you should pass the real
# application path instead of the path to the symlink to PHP
# FPM.
# Otherwise, PHP's OPcache may not properly detect changes to
# your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
# for more information).
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
# Prevents URIs that include the front controller. This will 404:
# http://domain.tld/app.php/some-path
# Remove the internal directive to allow URIs like this
internal;
} location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
} # return 404 for all other php files not matching the front controller
# this prevents access to other php files you don't want to be accessible.
location ~ \.php$ {
return 404;
} error_log "E:\phpStudy\PHPTutorial\WWW\yourProjectName\var\logs\project_error.log";
access_log "E:\phpStudy\PHPTutorial\WWW\yourProjectName\var\logs\project_access.log";
} # 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;
# server_name localhost; # ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key; # ssl_session_timeout 5m; # ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on; # location / {
# root html;
# index index.html index.htm;
# }
#} include vhosts.conf; }

附:

1、nginx配置详解

基本配置与参数: http://www.nginx.cn/76.html

localtion: http://outofmemory.cn/code-snippet/742/nginx-location-configuration-xiangxi-explain

2、Apache配置详解

文章:https://www.cnblogs.com/pengyunjing/p/6654182.html

Apache官网文档:https://httpd.apache.org/docs/2.4/sections.html

------

------------------------

在win nginx下配置symfony3.4,并隐藏项目名称 .php入口的更多相关文章

  1. 如何在Nginx下配置PHP程序环境

    1.nginx与PHP的关系 首先来看nginx与php的关系, FastCGI的关系(而不是像apache那样安装成nginx的模块) FastCGI的意思是, 快速的通用网关接口:CGI Comm ...

  2. NGINX下配置404错误页面的方法分享

    NGINX下配置自定义的404页面是可行的,而且很简单,只需如下几步,需要的朋友可以参考下   1. 创建自己的404.html页面 2.更改nginx.conf在http定义区域加入: fastcg ...

  3. Ubuntu Nginx下配置网站ssl实现https访问

    最近在看  HTTP权威指南   看到介绍了HTTPS的ssl,自己就动手测试了下,将步骤记录下 HTTPS简介 什么是HTTPS?百科是这样解释的.HTTPS(全称:Hyper Text Trans ...

  4. codeigniter(ci)在nginx下返回404的处理方法即codeigniter在nginx下配置方法

    codeigniter(ci)在nginx下返回404的处理方法即codeigniter在nginx下配置方法 进入nginx的配置文件 加上一句(本来就有这句,只需要修改一下就行了) locatio ...

  5. tpadmin的坑收集 nginx下配置tp5失败

    如下: 1.ADMIN模块如要关联查询,model的函数名一定不要有“_”下划线,否则找不到 /common/model/**.php 如果把函数名file写成“**_file”,调用时,$vo.** ...

  6. nginx下配置多个web服务

    参考 nginx配置详解  nginx反向代理与负载均衡详解 一.nginx简介: Nginx("engine x")是一款是由俄罗斯的程序设计师Igor Sysoev所开发高性能 ...

  7. macOS Sierra Version 10.12.6 环境下Tomcat的下载与安装以及InterlliJ IDEA 2017.2 环境下配置Tomcat 与创建Web项目

    一.Tomcat的下载与安装 1.官网(http://tomcat.apache.org/)下载Tomcat 9.0 Core:zip包: 2.解压到指定的文件夹即可安装完成: 3.测试是否安装成功 ...

  8. Nginx下配置ThinkPHP的URL Rewrite模式和pathinfo模式支持

    前面有关于lnmp环境的搭建,在此就不在赘述.下面就简述thinkPHP如何在nginx下开启url_rewrite和pathinfo模式支持 主要有两个步骤: 一.更改php.ini将;cgi.fi ...

  9. nginx下配置二级域名指向子目录

    今天终于把nginx的二级域名配置搞定了,哎之前在测试服务器上弄过一次,不过那个是在本地解析的hosts,把ip指向到域名上就ok,再在nginx.conf里改了下配置就好了,用同样的方法改了正式服务 ...

  10. Nginx下配置虚拟主机的三种方法

    Nginx下,一个server标签就是一个虚拟主机. 1.基于域名的虚拟主机,通过域名来区分虚拟主机——应用:外部网站 2.基于端口的虚拟主机,通过端口来区分虚拟主机——应用:公司内部网站,外部网站的 ...

随机推荐

  1. 效率起飞!天翼云并行文件服务HPFS高效应对AI时代大模型训练存储挑战!

    国内外AI大模型层出不穷,训练数据复杂程度更是呈指数级增加.如今,在万亿级参数时代,单个资源池已无法满足大模型训练场景中动辄PB级的数据存储量,对于企业来说,启用多个资源池构成的分布式存储势在必行. ...

  2. 陶瓷电容(MLCC),你真的了解吗?

    摘要:本文主要介绍陶瓷电容(MLCC)的结构.阻抗-频率特性.直流偏压特性.温度特性和关键参数. 一.物理结构 多层片式陶瓷电容器(Multi-layer Ceramic Capacitor,MLCC ...

  3. Flink同步mysql到iceberg

    一.如何做一致性保障 1.全量数据分片读取,增量数据单并发读取,保证增量阶段不会乱序2.全量阶段写入失败会清空表后重新写入,避免重复数据.3.全量阶段多task并行读取,把每个task开始结束时间提交 ...

  4. 超详细,DeepSeep 接入PyCharm实现AI编程!(支持本地部署DeepSeek及官方DeepSeek接入),建议收藏!

    在当今数字化时代,AI编程助手已成为提升开发效率的利器.DeepSeek作为一款强大的AI模型,凭借其出色的性能和开源免费的优势,成为许多开发者的首选.今天,就让我们一起探索如何将DeepSeek接入 ...

  5. [CF494D] Birthday 题解

    首先 \(S(u)\) 显然是 \(u\) 的子树. 假如 \(u\) 是定点,问题转化为区间求平方和,十分简单. 于是我们用线段树维护区间平方和,支持区间加,然后离线问题,在 \(u\) 的位置处理 ...

  6. autohue.js:让你的图片和背景融为一体,绝了!

    需求 先来看这样一个场景,拿一个网站举例 这里有一个常见的网站 banner 图容器,大小为为 1910*560 ,看起来背景图完美的充满了宽度,但是图片原始大小时,却是: 它的宽度只有 1440 , ...

  7. Vulnhub-Zico2靶机-漏扫弱口令数据库+文件包含反弹shell+zip,tar提权

    一.靶机搭建 选择扫描虚拟机 选择路径即可 二.信息收集 官方信息 先看一下官网的信息 级别:中级 目标:获取root并读取标志文件 说明: Zico正试图建立自己的网站,但在选择使用什么CMS时遇到 ...

  8. camunda工作流实战项目(表单设计器+流程编辑器,零代码创建流程)

    该项目的plus版本已制作完成,文章链接 [plus版]camunda工作流实战项目 一.整体情况介绍 基于ruoyi平台和camunda工作流开发而成,结合bpmn.js流程编辑器和vform表单设 ...

  9. 值得推荐的IT公司名单(成都篇)

    成都,作为新一线城市中的科技强市,拥有众多优秀的 IT 公司,为广大 IT 从业者提供了丰富的就业机会和良好的职业发展环境.以下是一些值得推荐的 IT 公司(排名不分先后): 一.互联网巨头在成都 1 ...

  10. Selenium KPI接口 警告弹 -alert/confirm/promp

    应用场景: 有些页面进入后自带弹窗提醒功能需要确认,这时候就需要将焦点定位到alert弹窗上. 使用格式: alert=driver.switchtoalert() alert.accept() 实现 ...