Skip to content

Commit

Permalink
Modified: add 80 port and 443 port at same time; Wayde
Browse files Browse the repository at this point in the history
  • Loading branch information
sunzhongmou committed Sep 1, 2019
1 parent 5732f27 commit c410152
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
@@ -1,6 +1,11 @@
Changelog
=========

0.1.0
-----

- Provide all in one configure file

0.0.8
-----

Expand Down
2 changes: 1 addition & 1 deletion ddd_nginx/__version__.py
@@ -1 +1 @@
__version__ = '0.0.8'
__version__ = '0.1.0'
1 change: 1 addition & 0 deletions ddd_nginx/nginx.py
Expand Up @@ -101,6 +101,7 @@ def dumps(self, directory):
os.path.join(directory, "error_page.conf"))

all_in_one = self.dump("all-in-one.conf.jinja2", {
"namespace": self.namespace,
"maps": maps,
"upstreams": upstreams,
"servers": servers,
Expand Down
1 change: 1 addition & 0 deletions ddd_nginx/template/apigw/server-location.conf.jinja2
Expand Up @@ -4,6 +4,7 @@ server {
{% endfor %}
access_log /var/log/nginx/api_access.log {{ name }};

listen 80;
listen 443 ssl;
server_name {{ name }};

Expand Down
1 change: 1 addition & 0 deletions ddd_nginx/template/apigw/server.conf.jinja2
Expand Up @@ -4,6 +4,7 @@ server {
{% endfor %}
access_log /var/log/nginx/api_access.log {{ name }};

listen 80;
listen 443 ssl;
server_name {{ name }};

Expand Down
1 change: 1 addition & 0 deletions tests/test_data/server-location.conf
Expand Up @@ -2,6 +2,7 @@ server {
set $api_name -;
access_log /var/log/nginx/api_access.log api.example.com;

listen 80;
listen 443 ssl;
server_name api.example.com;

Expand Down
1 change: 1 addition & 0 deletions tests/test_data/server.conf
Expand Up @@ -2,6 +2,7 @@ server {
set $api_name -;
access_log /var/log/nginx/api_access.log api.example.com;

listen 80;
listen 443 ssl;
server_name api.example.com;

Expand Down
3 changes: 2 additions & 1 deletion tests/test_nginx.py
Expand Up @@ -102,6 +102,7 @@ def test_dumps():
assert os.path.isdir(os.path.join(root_dir, "locations_conf.d")) is True
assert os.path.isfile(os.path.join(root_dir, "error_page.conf"))
assert os.path.isfile(os.path.join(root_dir, "root.conf"))
assert os.path.isfile(os.path.join(root_dir, "all-in-one.conf"))
assert os.path.isfile(os.path.join(root_dir, "0_map.conf"))
assert os.path.isfile(os.path.join(root_dir, "0_server.conf"))
assert os.path.isfile(os.path.join(root_dir, "0_upstream.conf"))
Expand All @@ -110,4 +111,4 @@ def test_dumps():
assert os.path.isfile(os.path.join(root_dir, "locations_conf.d/1_location.conf"))
assert os.path.isfile(os.path.join(root_dir, "locations_conf.d/2_location.conf"))

# remove_dir(root_dir)
remove_dir(root_dir)

0 comments on commit c410152

Please sign in to comment.