Tomcat accesses the project, usually ip + port + project name Nginx configures location / {}, which can usually only jump to ip + port. If you want to access the project directly, you need to modify the tomcat configuration. How to ensure that the port + project name can be accessed without modifying the configuration of tomcat and only modifying nginx After trying, I found a way to
Jump to
demo is the project name, which is the file name configured under tomcat's webapps This configuration will only display the project name in the URL address, but what does it matter? Here is an example configuration: upstream tomcatproject{ ip_hash; server 11.1.11.11:8080; server 22.2.22.22:8080; } server { listen 80; #server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://tomcatproject/demo; } location /demo/ { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://tomcatproject; } } The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: MySQL 5.7.31 64-bit free installation version tutorial diagram
>>: Analyze the difference between computed and watch in Vue
How to implement Mysql switching data storage dir...
1. Preparation 1.1 Download the Python installati...
For Centos installation of MySQL, please refer to...
1. Nginx installation steps 1.1 Official website ...
Preface In MySQL, both Innodb and MyIsam use B+ t...
In the forum, netizens often ask, can I read the ...
Table of contents Preface 1. scp usage 2. Use sft...
Let's take a look at the command to restart t...
In Dockerfile, run, cmd, and entrypoint can all b...
This article records the installation graphic tut...
1. CSS writing format 1. Inline styles You can wr...
What are slots? We know that in Vue, nothing can ...
Preface I encountered a situation at work: In the...
[Usage and function of mysql cursor] example: The...
SQL statement DROP TRIGGER IF EXISTS sys_menu_edi...