Home  >  Article  >  Backend Development  >  Configure resin+nginx under linux

Configure resin+nginx under linux

WBOY
WBOYOriginal
2016-08-08 09:21:12902browse

Find the resin.xml configuration file and add cluster nodes


      这里的test 是你的项目名称
     .
    
        -Xmx512m
        -Xms512m
        -Xmn128M
     -XX:-UseGCOverheadLimit
        -Xss50M
        -XX:PermSize=128M
        -XX:MaxPermSize=512M
        -XX:SurvivorRatio=8
        -XX:MaxTenuringThreshold=7
        -XX:GCTimeRatio=19
        -XX:+UseParNewGC
        -XX:+UseConcMarkSweepGC
        -XX:+CMSPermGenSweepingEnabled
        -XX:+CMSClassUnloadingEnabled
        -XX:+UseCMSCompactAtFullCollection
        -XX:CMSFullGCsBeforeCompaction=2
        -XX:-CMSParallelRemarkEnabled
        -XX:+DisableExplicitGC
        -XX:CMSInitiatingOccupancyFraction=70
        -XX:SoftRefLRUPolicyMSPerMB=0
        -XX:+PrintClassHistogram
        -XX:+PrintGCDetails
        -XX:+PrintGCTimeStamps
        -XX:+PrintGCApplicationConcurrentTime
        -XX:+PrintGCApplicationStoppedTime
        -Xloggc:log/gc.log
        -XX:+HeapDumpOnOutOfMemoryError
        -XX:HeapDumpPath=/data/logs/heap/test/dump
     -Xdebug
        -Dcom.sun.management.jmxremote
 -Dcom.sun.management.jmxremote.ssl=false
 -Dcom.sun.management.jmxremote.password=false
 -Dcom.sun.management.jmxremote.authenticate=false
 5M
        1024
        65s
        2048
        15s
        这里的端口号必须唯一 是你访问项目的端口号,也是要和nginx配置的端口号一致
    

This port can be changed as desired

;web-app id="/test" document-directory="/data/service/test" archive-path="/data/jenkins/Test.war" redeploy-mode="automatic"/>
"
               


id Project access path

document-directory Project package war decompression path

archive-path Project war package path

stdout-log path log path


Configuring and starting resin, you can access the test project http:// (linuxIP address): 8095 (port number set above )/test project name http://localhost:8095/test

If we want to access this project without entering the port number, we can use nginx reverse proxy to achieve this. In Configure nginx below to reverse proxy

Find the nginx.conf configuration file to modify the configuration file

increase the upstream test {

server 127.0.0.1:8095; }


Define location

location ^~/test/{

proxy_pass http://test; Page access path

proxy_redirect default;

proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
                  proxy_set_header X-Forwarded -Host $server_name; Client_max_body_size 80m;
In these two places

start nginx and enter http://localhost/test

in the browser. If you can access it normally, it means that the nginx proxy has been configured successfully.


Copyright Statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.

The above introduces the configuration of resin+nginx under Linux, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn