Supercharge Your Innovation With Domain-Expert AI Agents!

System and method for dynamically changing Nginx configuration based on Java

A dynamic change, java application technology, applied in the direction of program control device, program loading/starting, instrument, etc., can solve the problems of not elegant user experience, potential safety hazards, high development and learning costs, etc.

Pending Publication Date: 2021-03-16
SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF6 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

This method needs to enter the server where Nginx is located to modify it, which has potential security risks; the user experience is not elegant enough, and the cost of development and learning is extremely high

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • System and method for dynamically changing Nginx configuration based on Java
  • System and method for dynamically changing Nginx configuration based on Java

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0040] combined with figure 1 , the present embodiment proposes a system for dynamically changing Nginx configuration based on Java, which includes:

[0041] Java application module 1 is used to provide a Restful API interface for reading configuration information of Nginx, and generate Nginx configuration files based on the read configuration information, and the generated configuration files are uniformly stored in the Nginx configuration file directory. The format of the configuration file is .conf or .stream;

[0042] Nginx configuration module 2 is used to configure the configuration file generated by Java application module 1;

[0043] The data storage module 3 is used to persistently store the configuration information of Nginx;

[0044] Timing task module 4, built in Java application module 1, is used to regularly scan the configuration file of Nginx, and poll to detect whether the configuration file of Nginx changes. If there is a change, call the command of the sys...

Embodiment 2

[0053] combined with figure 2 , the present embodiment proposes a method for dynamically changing Nginx configuration based on Java, and its implementation process includes:

[0054] The database persistently stores the configuration information of Nginx;

[0055] The Java application reads the configuration information of Nginx from the database, generates an Nginx configuration file in the format of .conf or .stream, and stores it in the Nginx configuration file directory;

[0056] The Nginx application reads and configures the Nginx configuration file;

[0057] The Java application provides a Restful API interface through which external applications can be accessed;

[0058] The Java application has a built-in timing task to regularly scan the Nginx configuration file, and poll to detect whether the Nginx configuration file has changed. If there is a change, the command of the system where the Java application is located is called to execute the Nginx hot loading command...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a system and a method for dynamically changing Nginx configuration based on Java, which relate to the technical field of software development. The method includes: a Java application module for providing an API in a Restful form, reading configuration information of Nginx, and generating a configuration file of Nginx based on the read configuration information; a Nginx configuration module for configuring a configuration file generated by the Java application module; a data storage module for persistently storing the configuration information of the Nginx; a timed taskmodule which is arranged in the Java application module and is used for regularly scanning the configuration file of the Nginx and detecting whether the configuration file of the Nginx is changed or not in a polling manner, and if the configuration file of the Nginx is changed, a command of a system where the Java application is located is called to execute a hot loading command of the Nginx, so that the configuration file takes effect. According to the method, the Nginx configuration is newly added, deleted and dynamically refreshed, and the configuration of the Nginx is thermally loaded withrelatively small delay, so that the Nginx configuration takes effect automatically, manual access to Nginx configuration file modification is avoided, and the Nginx configuration is simpler, more effective and more convenient.

Description

technical field [0001] The invention relates to Nginx configuration files, in particular to a system and method for dynamically changing Nginx configuration based on Java. Background technique [0002] Java is a widely used computer programming language with the characteristics of cross-platform, object-oriented, and generic programming. It is widely used in enterprise-level web application development and mobile application development. [0003] Nginx (engine x) is a high-performance HTTP and reverse proxy web server, and also provides IMAP / POP3 / SMTP services, because of its stability, rich feature set, sample configuration files and low system resource consumption. It is well-known and can run on UNIX, GNU / Linux, BSD, Mac OS X, Solaris, and Microsoft Windows and other operating systems. [0004] Nginx officially does not provide an API interface that can dynamically change the configuration. The current modification method is mostly to manually modify the Nginx configurat...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F9/445
CPCG06F9/44505G06F9/44521Y02D10/00
Inventor 魏金雷肖培玉高传集徐士强赵子恒
Owner SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More