Commit babb83a7 authored by Kostis Trantzas's avatar Kostis Trantzas
Browse files

fix for #11.

- CORS error: added "origins": "http://localhost" at APIs environment variable in docker-compose.yaml.configure
- Headers forwarding strategy:
  - added "server.forward-headers-strategy":"FRAMEWORK" at APIs environment variable in docker-compose.yaml.configure
  - added proxy_set_header  X-Forwarded-Proto $scheme; at APIs configuration in nginx/nginx.conf.default
parent e0c15a17
Loading
Loading
Loading
Loading
+11 −4
Original line number Original line Diff line number Diff line
@@ -89,6 +89,7 @@ services:
    image: org.etsi.osl.portal.api:latest
    image: org.etsi.osl.portal.api:latest
    environment:
    environment:
      SPRING_APPLICATION_JSON: '{
      SPRING_APPLICATION_JSON: '{
        "origins": "http://localhost",
        "spring.datasource.url": "jdbc:mysql://amysql/osdb?createDatabaseIfNotExist=true",
        "spring.datasource.url": "jdbc:mysql://amysql/osdb?createDatabaseIfNotExist=true",
        "spring.datasource.username":"root",
        "spring.datasource.username":"root",
        "spring.datasource.password":"letmein",
        "spring.datasource.password":"letmein",
@@ -106,7 +107,8 @@ services:
        "spring.activemq.password": "artemis",
        "spring.activemq.password": "artemis",
        "logging.level.org.springframework" : "INFO",
        "logging.level.org.springframework" : "INFO",
        "spring.portal.main.domain": "http://localhost",
        "spring.portal.main.domain": "http://localhost",
        "spring.portal.portal.title": "Openslice"
        "spring.portal.portal.title": "Openslice",
        "server.forward-headers-strategy":"FRAMEWORK"
      }'
      }'
    logging:
    logging:
      driver: "json-file"
      driver: "json-file"
@@ -186,6 +188,7 @@ services:
    image: org.etsi.osl.tmf.api:latest
    image: org.etsi.osl.tmf.api:latest
    environment:
    environment:
      SPRING_APPLICATION_JSON: '{
      SPRING_APPLICATION_JSON: '{
        "origins": "http://localhost",
        "spring.datasource.url": "jdbc:mysql://amysql/ostmfdb?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC",
        "spring.datasource.url": "jdbc:mysql://amysql/ostmfdb?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC",
        "spring.datasource.username":"root",
        "spring.datasource.username":"root",
        "spring.datasource.password":"letmein",
        "spring.datasource.password":"letmein",
@@ -202,7 +205,8 @@ services:
        "spring.activemq.user": "artemis",
        "spring.activemq.user": "artemis",
        "spring.activemq.password": "artemis",
        "spring.activemq.password": "artemis",
        "logging.level.org.springframework" : "INFO",      
        "logging.level.org.springframework" : "INFO",      
        "kroki.serverurl" : "http://localhost/kroki"  
        "kroki.serverurl" : "http://localhost/kroki",
        "server.forward-headers-strategy":"FRAMEWORK"  
      }'
      }'
    volumes:
    volumes:
    - ./repo:/root
    - ./repo:/root
@@ -251,6 +255,7 @@ services:
    image: org.etsi.osl.oas:latest
    image: org.etsi.osl.oas:latest
    environment:
    environment:
      SPRING_APPLICATION_JSON: '{
      SPRING_APPLICATION_JSON: '{
        "origins": "http://localhost",
        "spring.datasource.url": "jdbc:mysql://amysql/ostmfdb?createDatabaseIfNotExist=true&useUnicode=true&nullCatalogMeansCurrent=true&characterEncoding=utf8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC",
        "spring.datasource.url": "jdbc:mysql://amysql/ostmfdb?createDatabaseIfNotExist=true&useUnicode=true&nullCatalogMeansCurrent=true&characterEncoding=utf8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC",
        "spring.datasource.username":"root",
        "spring.datasource.username":"root",
        "spring.datasource.password":"letmein",
        "spring.datasource.password":"letmein",
@@ -266,7 +271,8 @@ services:
        "spring.activemq.brokerUrl": "tcp://anartemis:61616?jms.watchTopicAdvisories=false",
        "spring.activemq.brokerUrl": "tcp://anartemis:61616?jms.watchTopicAdvisories=false",
        "spring.activemq.user": "artemis",
        "spring.activemq.user": "artemis",
        "spring.activemq.password": "artemis",
        "spring.activemq.password": "artemis",
        "logging.level.org.springframework" : "INFO"        
        "logging.level.org.springframework" : "INFO",
        "server.forward-headers-strategy":"FRAMEWORK"        
      }'
      }'
    volumes:
    volumes:
    - ./repo:/root
    - ./repo:/root
@@ -328,7 +334,8 @@ services:
        "spring.activemq.brokerUrl": "tcp://anartemis:61616?jms.watchTopicAdvisories=false",
        "spring.activemq.brokerUrl": "tcp://anartemis:61616?jms.watchTopicAdvisories=false",
        "spring.activemq.user": "artemis",
        "spring.activemq.user": "artemis",
        "spring.activemq.password": "artemis",
        "spring.activemq.password": "artemis",
        "centrallogurl":"http://elk_ip:elk_port/index_name/_doc"
        "centrallogurl":"http://elk_ip:elk_port/index_name/_doc",
        "logging.level.org.springframework" : "INFO"
      }'
      }'
    ports:
    ports:
    - 13013:13013
    - 13013:13013
+36 −53
Original line number Original line Diff line number Diff line
@@ -41,14 +41,6 @@ http {
            try_files $uri $uri/ /index.html;
            try_files $uri $uri/ /index.html;
        }
        }



#        location / {
#                        root /webstatic/nfvportal/openslicehome;
#                        index index.html;
#        }



        location /nfvportal {
        location /nfvportal {
            root /webstatic;
            root /webstatic;
            index index.html;
            index index.html;
@@ -56,13 +48,12 @@ http {
            try_files $uri $uri/ /nfvportal/index.html;
            try_files $uri $uri/ /nfvportal/index.html;
        }
        }



        	
        location /osapi {
        location /osapi {
	        proxy_pass http://osportalapi:13000/osapi;
	        proxy_pass http://osportalapi:13000/osapi;
			proxy_set_header  X-Real-IP $remote_addr;
			proxy_set_header  X-Real-IP $remote_addr;
			proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_set_header  Host $http_host;
			proxy_set_header  Host $http_host;
            proxy_set_header  X-Forwarded-Proto $scheme;
        }
        }
        
        
        location /tmf-api {
        location /tmf-api {
@@ -70,6 +61,7 @@ http {
			proxy_set_header  X-Real-IP $remote_addr;
			proxy_set_header  X-Real-IP $remote_addr;
			proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_set_header  Host $http_host;
			proxy_set_header  Host $http_host;
            proxy_set_header  X-Forwarded-Proto $scheme;
        }
        }
        
        
        location /oas-api {
        location /oas-api {
@@ -77,8 +69,10 @@ http {
			proxy_set_header  X-Real-IP $remote_addr;
			proxy_set_header  X-Real-IP $remote_addr;
			proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_set_header  Host $http_host;
			proxy_set_header  Host $http_host;
            proxy_set_header  X-Forwarded-Proto $scheme;
        }
        }
        
        
        # For http
        location /auth {
        location /auth {
            proxy_pass http://keycloak:8080/auth;
            proxy_pass http://keycloak:8080/auth;
            proxy_set_header  X-Real-IP $remote_addr;
            proxy_set_header  X-Real-IP $remote_addr;
@@ -94,7 +88,7 @@ http {
            proxy_set_header  Host $http_host;
            proxy_set_header  Host $http_host;
        }
        }



        # For https
#        location /auth {
#        location /auth {
#            proxy_pass https://keycloak:8443/auth;
#            proxy_pass https://keycloak:8443/auth;
#            proxy_set_header  X-Real-IP $remote_addr;
#            proxy_set_header  X-Real-IP $remote_addr;
@@ -105,18 +99,7 @@ http {
#            proxy_set_header X-Forwarded-Port   443;
#            proxy_set_header X-Forwarded-Port   443;
#       }
#       }
        
        

        

    }
    }




	





}
}