phax / phoss-smp

phoss SMP - a Peppol and OASIS BDXR SMP Server, CEF eDelivery compliant
132 stars 37 forks source link

Change perform SMP query url to external fqdn #123

Closed ghost closed 4 years ago

ghost commented 4 years ago

After creating a Service Group and Endpoint I want to perform an SMP query but this is being redirected to http://localhost:8080. How to change this to the external URL?

My SMP URL is: https://smp.api.dev.calvi-insight.com/public

image

phax commented 4 years ago

Hi @sanderverhoeven, most likely you are missing the smp.publicurl configuration file entry s described in https://github.com/phax/phoss-smp/wiki/Configuration#smp-serverproperties This is needed especially if you run the SMP behind a reverse proxy. hth

ghost commented 4 years ago

Hi @phax

this is my configuration of the smp-server.properties:

 Copyright (C) 2014-2020 Philip Helger and contributors
 philip[at]helger[dot]com

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

 The backend to be used. Can either be "sql" or "xml" or "mongodb". Any other value will result in a startup error
 Default is XML so that the tests run flawlessly
smp.backend = xml

 Keystore data
 The path maybe within the classpath or an absolute file path
smp.keystore.type         = P12
smp.keystore.path         = ***
smp.keystore.password     = ***
smp.keystore.key.alias    = ***
smp.keystore.key.password = ***

 This default truststore handles 2010 and 2018 PKIs
smp.truststore.type     = jks
smp.truststore.path     = complete-truststore.jks
smp.truststore.password = peppol

 Force all paths (links) to be "/" instead of the context path
 This is helpful if the web application runs in a context like "/smp" but is proxied to a root path
smp.forceroot = false

 If this property is specified, it will overwrite the automatically generated URL
 for all cases where absolute URLs are necessary
 This might be helpful when running on a proxied Tomcat behind a web server
smp.publicurl = smp.api.dev.calvi-insight.com

 The SMP ID also used in the SML!
sml.smpid=PNL000169

 SML connection timeout milliseconds 
sml.connection.timeout.ms = 5000

 SML request timeout milliseconds
sml.request.timeout.ms = 20000

 Enable PEPPOL Directory integration?
smp.peppol.directory.integration.enabled=true

 Use PEPPOL identifiers (with all constraints) or simple, unchecked identifiers?
 Possible values are "peppol", "simple" and "bdxr"
smp.identifiertype=peppol

 Define the type of the REST interface. Use this to switch between PEPPOL and BDXR
 return XMLs. Possible values are "peppol" and "bdxr"
smp.rest.type=peppol

 Log exceptions occurring in the REST API that are returned as HTTP errors?
smp.rest.log.exceptions=false

 Add payload to HTTP responses in case of REST API errors?
smp.rest.payload.on.error=true

Do I have to set the smp.publicurl like http://smp.api.dev.calvi-insight.com?

phax commented 4 years ago

yes, the public URL should start with "http://". And Keystore type should be PKCS12 and not P12 I assume. Concerning the SMP ID you can use something more "speaking" than PNL000169 - e.g. "SMP-CALVI-DEV" or so.

phax commented 4 years ago

And if you are using a reverse proxy (like httpd or nginx) consider setting smp.forceroot to true as well

ghost commented 4 years ago

Problem was that i was using IIS rewrite module. thank you for the support. Now running on kubernetes cluster which solved the problem.