nginx带有Java(前后分离)和PHP环境的配置
#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;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /data/app/mall;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
location /house {
rewrite ^.+house/?(.*)$ /$1 break;
include uwsgi_params;
proxy_pass http://localhost:9002;
}
# location /marryPhphoutai/ {
# 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;
# }
#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;
}
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_comp_level 4;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
# 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 /data/app/marry/api;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
# }
location ~ \.php$ {
root /data/app/mall;
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;
}
# 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;
# }
# 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;
# }
#}
}
nginx带有Java(前后分离)和PHP环境的配置的更多相关文章
- Java中jdk安装与环境变量配置
Java中jdk安装与环境变量配置 提示:下面是jdk1.7和jdk1.8的百度网盘链接 链接:https://pan.baidu.com/s/1SuHf4KlwpiG1zrf1LLAERQ 提取码: ...
- java Android SDK安装与环境变量配置以及开发第一个Android程序
JAVA的安装与环境变量的配置 1.先下载JAVA,并且安装. 下载地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u3 ...
- java、maven、tomcat 环境变量配置
Linux 配置java.maven.tomcat 环境变量 打开 /etc/profile 在下面写上 # java env JAVA_HOME=/usr/local/tools/java (j ...
- Java学习笔记2、环境变量配置与初学者常见错误
2.1 环境变量的配置 2.1.1 path环境变量配置的作用 程序的执行需要使用外部指令javac,但是javac指令仅仅能在JDK安装目录下的bin目录下运行,因此程序只能写入bin目录程序开 ...
- 【Java】JDK安装及环境变量配置
第一步:下载所需jdk(本次下载Win64位 java1.8...版本) 第二步:点击文件安装,直接下一步到底,成功安装,点击关闭. 第三步:安装完JDK后配置环境变量 计算机→属性→高级系统设置→ ...
- JAVA JDK安装及path环境变量配置
JDK安装 JVM :JAVA虚拟机 JRE :java运行环境=JVM+核心类库 JDK :JAVA开发工具包=JRE+java开发工具 java开发工具:编译工具(javac.exe) . 运行 ...
- Java的JDK以及maven环境变量配置
右键我的电脑->属性->高级->环境变量->系统变量 新建变量名(win7,win10系统变量)JAVA_HOME变量值填写D:\Java\jdk1.8.0_172为jdk的安 ...
- Nginx部署前后端分离的单页应用配置
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #erro ...
- Core Java 学习笔记——1.术语/环境配置/Eclipse汉化字体快捷键/API文档
今天起开始学习Java,学习用书为Core Java.之前有过C的经验.准备把自己学习这一本书时的各种想法,不易理解的,重要的都记录下来.希望以后回顾起来能温故知新吧.也希望自己能够坚持把自己学习这本 ...
- win7环境下配置Java环境
==下载Java SE Development Kit 8u45== http://www.oracle.com/technetwork/java/javase/downloads/jdk8-down ...
随机推荐
- WindowsPE文件格式入门11.资源表
https://www.bpsend.net/thread-411-1-1.html 资源表 资源的管理方式采用windows资源管理器目录的管理方式,一般有三层目录. 根目录 结构体IMAGE_RE ...
- 由 Array.includes 函数引发对引用数据类型的思考
`` 数组的includes方法在日常的编程中比较常用到,其作用就是判断某一数据是否在数组中,通常来说,数组中的数据如果是数字,布尔值,或者字符串的话,都是能够进行判断的 例如: [1,2,3,4]. ...
- MyBatis常见面试题:说说MyBatis的工作原理
本文转自参考文献3. SSM风靡当前的Java世界,面试官不经意间就会甩出一道必杀题:请你说一下MyBatis的工作原理.虽然大家每天都在使用MyBatis做增删改查的工作,但是面对这个问题往 ...
- electron-vite多窗口案例
案例使用electron-vite加载2个窗口,每个窗口加载不同的url 配置electron.vite.config.mjs 指向对应的渲染文件,没有就创建 主进程创建窗口时指向预加载文件和要加载的 ...
- snmp总结一:概述
snmp总结一:概述 SNMP概述 SNMP是英文"Simple Network Management Protocol"的缩写,中文意思是"简单网络管理协议" ...
- 案例分析——HyperWorks练习做模型简化
Step 01:载入模型 Exercise_2b.hm. 图 2-20 Exercise_2b 模型alt="Exercise_2b 模型" Step 02:去除曲边导角. ( ...
- Java 通用对象数值比较方法
前言 请各大网友尊重本人原创知识分享,谨记本人博客:南国以南i. 提示:以下是本篇文章正文内容,下面案例可供参考 说明 主要用于比较两个对象是否相等,特别处理了数值类型的比较(包括字符串形式的数值) ...
- Java学习篇(三)—— 集合框架
集合框架是什么? 对容器的学习建议结合leecode,了解每一个容器的增删改查操作. 数据结构里学习了几种数据结构类型:数组.链表.栈.队列.树.哈希表.堆.在C++中,C++ STL提供了数组vec ...
- 关于自定义比较函数 usort 如何使用 类中的方法
http://blog.csdn.net/qdujunjie/article/details/42081137
- 使用frpc 进行windows 内网穿透
简介 内网穿透还是一个常用的需求. 参考链接 http://www.codingwhy.com/view/2504.html 软件下载 https://github.com/codemonkey-m/ ...